Codechange: refactor removal of desert around river tiles

This commit is contained in:
SamuXarick
2023-01-14 23:43:41 +00:00
committed by GitHub
parent 20a9e13272
commit 96ec9908a0
3 changed files with 19 additions and 32 deletions

View File

@@ -427,6 +427,18 @@ bool RiverModifyDesertZone(TileIndex tile, void *)
return false;
}
/**
* Make a river tile and remove desert directly around it.
* @param tile The tile to change into river and create non-desert around
*/
void MakeRiverAndModifyDesertZoneAround(TileIndex tile) {
MakeRiver(tile, Random());
MarkTileDirtyByTile(tile);
/* Remove desert directly around the river tile. */
CircularTileSearch(&tile, RIVER_OFFSET_DESERT_DISTANCE, RiverModifyDesertZone, nullptr);
}
/**
* Build a piece of canal.
* @param flags type of operation