1
0
Fork 0

Fix: Missing water region invalidation after flooding a half tile with rail in the highest corner

Invalidate water region when any flood occurs.
Convert a few magic numbers to their names.
pull/13303/merge
SamuXarick 2024-10-31 15:58:12 +00:00 committed by Kuhnovic
parent 097937ecdf
commit 610026ef17
2 changed files with 3 additions and 2 deletions

View File

@ -773,13 +773,13 @@ bool FloodHalftile(TileIndex t)
TrackBits lower_track = CornerToTrackBits(OppositeCorner(GetHighestSlopeCorner(tileh)));
TrackBits to_remove = lower_track & rail_bits;
if (to_remove != 0) {
if (to_remove != TRACK_BIT_NONE) {
Backup<CompanyID> cur_company(_current_company, OWNER_WATER);
flooded = Command<CMD_REMOVE_SINGLE_RAIL>::Do(DC_EXEC, t, FindFirstTrack(to_remove)).Succeeded();
cur_company.Restore();
if (!flooded) return flooded; // not yet floodable
rail_bits = rail_bits & ~to_remove;
if (rail_bits == 0) {
if (rail_bits == TRACK_BIT_NONE) {
MakeShore(t);
MarkTileDirtyByTile(t);
return flooded;

View File

@ -1187,6 +1187,7 @@ static void DoFloodTile(TileIndex target)
UpdateSignalsInBuffer();
if (IsPossibleDockingTile(target)) CheckForDockingTile(target);
InvalidateWaterRegion(target);
}
cur_company.Restore();