mirror of https://github.com/OpenTTD/OpenTTD.git
(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
|
/* Exclude the source position from the bitmask
|
||||||
* and return if no more road blocks available */
|
* 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) {
|
if (cur_rb == ROAD_NONE) {
|
||||||
return _grow_town_result;
|
return _grow_town_result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue