Codechange: migrate size related functions to Map structure

This commit is contained in:
Rubidium
2023-01-21 10:43:03 +01:00
committed by rubidium42
parent d481f78b24
commit fe2bcd2a58
56 changed files with 334 additions and 343 deletions

View File

@@ -575,8 +575,8 @@ public:
if (!_settings_game.construction.freeform_edges) {
/* When end_tile is MP_VOID, the error tile will not be visible to the
* user. This happens when terraforming at the southern border. */
if (TileX(end_tile) == MapMaxX()) end_tile += TileDiffXY(-1, 0);
if (TileY(end_tile) == MapMaxY()) end_tile += TileDiffXY(0, -1);
if (TileX(end_tile) == Map::MaxX()) end_tile += TileDiffXY(-1, 0);
if (TileY(end_tile) == Map::MaxY()) end_tile += TileDiffXY(0, -1);
}
const ObjectSpec *spec = ObjectClass::Get(_selected_object_class)->GetSpec(_selected_object_index);
Command<CMD_BUILD_OBJECT_AREA>::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcPlaySound_CONSTRUCTION_OTHER,