Loading

Revision differences

Old revision #pixetasleNew revision #pqejnxxvj
1/**  1/**  
2 * Ensure this tile is not a target for ships to get to a nearby dock.  2 * Ensure this tile is not a target for ships to get to a nearby dock.  
3 * @note Also takes into account Oil Rigs under construction.  3 * @note Also takes into account Oil Rigs, even those under construction.
4 * @param tile Tile to query  4 * @param tile Tile to query  
5 * @param diagdir Optional diagonal direction to look for axis compatibility.  5 * @param diagdir Optional diagonal direction to look for axis compatibility.  
6 * @return Succeeded if the tile is not a ship docking area of a nearby dock,  6 * @return Succeeded if the tile is not a ship docking area of a nearby dock,  
  
10 *       docking area, it returns Succeeded. If diagdir is not provided, only  10 *       docking area, it returns Succeeded. If diagdir is not provided, only  
11 *       the docking area location is ensured.  11 *       the docking area location is ensured.  
12 */  12 */  
13CommandCost EnsureNoDockingTile(TileIndex tile, DiagDirection diagdir = INVALID_DIAGDIR)  13static CommandCost EnsureNoDockingTile(TileIndex tile, DiagDirection diagdir = INVALID_DIAGDIR)
14{  14{  
15    Axis axis = diagdir == INVALID_DIAGDIR ? INVALID_AXIS : DiagDirToAxis(diagdir);  15    Axis axis = diagdir == INVALID_DIAGDIR ? INVALID_AXIS : DiagDirToAxis(diagdir);  
16  16  
  
31            }  31            }  
32        }  32        }  
33        if (axis != AXIS_X && DiagDirToAxis(rot) == AXIS_X) {  33        if (axis != AXIS_X && DiagDirToAxis(rot) == AXIS_X) {  
34            if (IsTileType(tc + TileDiffXY(-1, 0), MP_INDUSTRY) && GetIndustryGfx(tc + TileDiffXY(-1, 0)) == GFX_OILRIG_1) return_cmd_error(STR_ERROR_SITE_UNSUITABLE);  34            if (IsTileType(tc + TileDiffXY(-1, 0), MP_INDUSTRY) && GetIndustryGfx(tc + TileDiffXY(-1, 0)) == GFX_OILRIG_1) {
   35                return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
   36            }
35        }  37        }  
36    }  38    }  
37  39