Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool CanTerraformFloodingTile(TileIndex tile, int z_new, Slope tileh_new)
- {
- if (GetFloodingBehaviour(tile) != FLOOD_NONE) {
- if (tileh_new == SLOPE_FLAT || z_new == 1) {
- return false;
- }
- Slope tileh = GetTileSlope(tile);
- if (IsSlopeWithThreeCornersRaised(tileh)) {
- if (tileh_new == SLOPE_NS || tileh_new == SLOPE_EW) {
- return true;
- }
- if (IsSteepSlope(tileh_new) &&
- OppositeCorner(GetHighestSlopeCorner(ComplementSlope(tileh))) == GetHighestSlopeCorner(tileh_new)) {
- return true;
- }
- }
- if (IsSteepSlope(tileh)) {
- if (IsSlopeWithThreeCornersRaised(tileh_new) &&
- GetHighestSlopeCorner(tileh) == OppositeCorner(GetHighestSlopeCorner(ComplementSlope(tileh_new)))) {
- return true;
- }
- }
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement