Used curved instead of square circular area for mapgen water desert removal

This commit is contained in:
Jonathan G Rennison
2024-01-09 03:18:02 +00:00
parent 69f7c3e63b
commit e0361791fd
3 changed files with 9 additions and 14 deletions

View File

@@ -443,10 +443,9 @@ CommandCost CmdBuildLock(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint3
}
/** Callback to create non-desert around a river tile. */
bool RiverModifyDesertZone(TileIndex tile, void *)
void RiverModifyDesertZone(TileIndex tile, void *)
{
if (GetTropicZone(tile) == TROPICZONE_DESERT) SetTropicZone(tile, TROPICZONE_NORMAL);
return false;
}
/**
@@ -459,7 +458,7 @@ void MakeRiverAndModifyDesertZoneAround(TileIndex tile)
MarkTileDirtyByTile(tile);
/* Remove desert directly around the river tile. */
CircularTileSearch(&tile, RIVER_OFFSET_DESERT_DISTANCE, RiverModifyDesertZone, nullptr);
IterateCurvedCircularTileArea(tile, RIVER_OFFSET_DESERT_DISTANCE, RiverModifyDesertZone, nullptr);
}
/**
@@ -525,8 +524,7 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint
case WATER_CLASS_RIVER:
MakeRiver(current_tile, Random());
if (_game_mode == GM_EDITOR) {
TileIndex tile2 = current_tile;
CircularTileSearch(&tile2, _settings_game.game_creation.river_tropics_width, RiverModifyDesertZone, nullptr);
IterateCurvedCircularTileArea(current_tile, _settings_game.game_creation.river_tropics_width, RiverModifyDesertZone, nullptr);
}
break;