mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 23:10:04 +00:00
(svn r26104) -Fix: do not attempt to do stuff with an invalid direction, especially using it as index into a table
This commit is contained in:
parent
f817b06c18
commit
c143ca729a
@ -1317,7 +1317,7 @@ static int GrowTownAtRoad(Town *t, TileIndex tile)
|
||||
|
||||
/* Exclude the source position from the bitmask
|
||||
* and return if no more road blocks available */
|
||||
cur_rb &= ~DiagDirToRoadBits(ReverseDiagDir(target_dir));
|
||||
if (IsValidDiagDirection(target_dir)) cur_rb &= ~DiagDirToRoadBits(ReverseDiagDir(target_dir));
|
||||
if (cur_rb == ROAD_NONE) {
|
||||
return _grow_town_result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user