@@ -427,6 +427,8 @@ int building_construction_fill_vacant_lots(grid_slice *area)
427427
428428int building_construction_place_building (building_type type , int x , int y , int exact_coordinates )
429429{
430+ int grid_offset = map_grid_offset (x , y );
431+
430432 int terrain_mask = TERRAIN_ALL ;
431433 if (building_type_is_roadblock (type )) {
432434 terrain_mask = type == BUILDING_GATEHOUSE ? ~TERRAIN_WALL & ~TERRAIN_ROAD &
@@ -455,7 +457,7 @@ int building_construction_place_building(building_type type, int x, int y, int e
455457 int building_orientation = 0 ;
456458 if (type == BUILDING_GATEHOUSE || type == BUILDING_WAREHOUSE ) {
457459 //check if there's a preset orientation from old building
458- building * old_b = building_main (building_get (map_building_rubble_building_id (map_grid_offset ( x , y ) )));
460+ building * old_b = building_main (building_get (map_building_rubble_building_id (grid_offset )));
459461 if (old_b && (old_b -> type == BUILDING_GATEHOUSE ||
460462 old_b -> type == BUILDING_WAREHOUSE || old_b -> type == BUILDING_WAREHOUSE_SPACE )) {
461463 building_orientation = old_b -> subtype .orientation ;
@@ -492,7 +494,7 @@ int building_construction_place_building(building_type type, int x, int y, int e
492494 city_warning_show (WARNING_CLEAR_LAND_NEEDED , NEW_WARNING_SLOT );
493495 return 0 ;
494496 }
495- if (!check_gatehouse_tiles (map_grid_offset ( x , y ) )) { //helper to make sure all building tiles are on walls
497+ if (!check_gatehouse_tiles (grid_offset )) { //helper to make sure all building tiles are on walls
496498 city_warning_show (WARNING_CLEAR_LAND_NEEDED , NEW_WARNING_SLOT );
497499 return 0 ;
498500 }
0 commit comments