@@ -63,8 +63,7 @@ void map_water_supply_update_houses() {
63
63
} else if (b.house_size ) {
64
64
b.has_water_access = false ;
65
65
b.has_well_access = 0 ;
66
- if (b.data .house .water_supply
67
- || map_terrain_exists_tile_in_area_with_type (b.tile .x (), b.tile .y (), b.size , TERRAIN_FOUNTAIN_RANGE)) {
66
+ if (b.data .house .water_supply || map_terrain_exists_tile_in_area_with_type (b.tile .x (), b.tile .y (), b.size , TERRAIN_FOUNTAIN_RANGE)) {
68
67
b.has_water_access = true ;
69
68
}
70
69
}
@@ -120,7 +119,7 @@ static void fill_canals_from_offset(int grid_offset) {
120
119
if (image_id >= image_without_water) {
121
120
map_image_set (grid_offset, image_id - IMAGE_CANAL_FULL_OFFSET);
122
121
}
123
- map_terrain_add_with_radius (MAP_X (grid_offset), MAP_Y (grid_offset), 1 , 2 , TERRAIN_IRRIGATION_RANGE);
122
+ map_terrain_add_with_radius (tile2i (grid_offset), 1 , 2 , TERRAIN_IRRIGATION_RANGE);
124
123
125
124
next_offset = -1 ;
126
125
for (int i = 0 ; i < 4 ; i++) {
@@ -201,7 +200,7 @@ static void update_canals_from_water_lifts() {
201
200
if (b->has_water_access ) {
202
201
fill_canals_from_offset (b->tile .grid_offset () + OUTPUT_OFFSETS[b->data .industry .orientation ][0 ]);
203
202
fill_canals_from_offset (b->tile .grid_offset () + OUTPUT_OFFSETS[b->data .industry .orientation ][1 ]);
204
- map_terrain_add_with_radius (b->tile . x (), b-> tile . y () , 2 , 2 , TERRAIN_IRRIGATION_RANGE);
203
+ map_terrain_add_with_radius (b->tile , 2 , 2 , TERRAIN_IRRIGATION_RANGE);
205
204
}
206
205
}
207
206
}
@@ -219,14 +218,12 @@ void map_update_canals(void) {
219
218
update_canals_from_water_lifts ();
220
219
}
221
220
222
- void map_update_wells_range (void ) {
221
+ void map_update_wells_range () {
223
222
OZZY_PROFILER_SECTION (" Game/Run/Tick/Wells Range Update" );
224
223
map_terrain_remove_all (TERRAIN_FOUNTAIN_RANGE);
225
- buildings_valid_do ([&](building& b) {
226
- if (b.type == BUILDING_WELL) {
227
- map_terrain_add_with_radius (b.tile .x (), b.tile .y (), 1 , 3 , TERRAIN_FOUNTAIN_RANGE);
228
- }
229
- });
224
+ buildings_valid_do ([](building& b) {
225
+ map_terrain_add_with_radius (b.tile , 1 , 3 , TERRAIN_FOUNTAIN_RANGE);
226
+ }, BUILDING_WELL);
230
227
}
231
228
232
229
e_well_status map_water_supply_is_well_unnecessary (int well_id, int radius) {
0 commit comments