mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r1332) -Fix: Desert-landscape does no longer crash (protected GetMapExtraBits
from overflowing)
This commit is contained in:
parent
6c4840fa50
commit
7e89cd8643
@ -444,7 +444,11 @@ void SetMapExtraBits(uint tile, byte bits)
|
||||
|
||||
uint GetMapExtraBits(uint tile)
|
||||
{
|
||||
return (_map_extra_bits[tile >> 2] >> (tile&3)*2)&3;
|
||||
if (GET_TILE_X(tile) < MapSizeX() && GET_TILE_Y(tile) < MapSizeY() &&
|
||||
GET_TILE_X(tile) > 0 && GET_TILE_Y(tile) > 0)
|
||||
return (_map_extra_bits[tile >> 2] >> (tile&3)*2)&3;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TILELOOP_BITS 4
|
||||
|
Loading…
Reference in New Issue
Block a user