mirror of https://github.com/OpenTTD/OpenTTD
(svn r1683) Fix placement of MP_VOID tiles. On square maps it accidently works, but on non-square maps the wrong tiles would get marked as MP_VOID
parent
478e001d0e
commit
a2971d0449
|
@ -492,10 +492,11 @@ void InitializeLandscape(void)
|
||||||
memset(_map_extra_bits, 0, map_size / 4);
|
memset(_map_extra_bits, 0, map_size / 4);
|
||||||
memset(_map_type_and_height, MP_CLEAR << 4, map_size);
|
memset(_map_type_and_height, MP_CLEAR << 4, map_size);
|
||||||
|
|
||||||
// create void tiles on the border
|
// create void tiles at the border
|
||||||
for (i = 0; i != MapMaxY(); i++)
|
for (i = 0; i < MapMaxY(); ++i)
|
||||||
_map_type_and_height[ i * MapSizeX() + MapMaxY() ] = MP_VOID << 4;
|
SetTileType(i * MapSizeX() + MapMaxX(), MP_VOID);
|
||||||
memset(_map_type_and_height + MapMaxY() * MapSizeX(), MP_VOID << 4, MapSizeX());
|
for (i = 0; i < MapSizeX(); ++i)
|
||||||
|
SetTileType(MapSizeX() * MapMaxY() + i, MP_VOID);
|
||||||
|
|
||||||
memset(_map5, 3, map_size);
|
memset(_map5, 3, map_size);
|
||||||
}
|
}
|
||||||
|
|
14
ttd.c
14
ttd.c
|
@ -1258,15 +1258,17 @@ static void UpdateCurrencies(void)
|
||||||
_opt.currency = convert_currency[_opt.currency];
|
_opt.currency = convert_currency[_opt.currency];
|
||||||
}
|
}
|
||||||
|
|
||||||
// up to revision 1413, the invisible tiles at the southern border have not been MP_VOID
|
/* Up to revision 1413 the invisible tiles at the southern border have not been
|
||||||
// even though they should have. This is fixed by this function
|
* MP_VOID, even though they should have. This is fixed by this function
|
||||||
|
*/
|
||||||
static void UpdateVoidTiles(void)
|
static void UpdateVoidTiles(void)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
// create void tiles on the border
|
|
||||||
for (i = 0; i != MapMaxY(); i++)
|
for (i = 0; i < MapMaxY(); ++i)
|
||||||
_map_type_and_height[ i * MapSizeX() + MapMaxY() ] = MP_VOID << 4;
|
SetTileType(i * MapSizeX() + MapMaxX(), MP_VOID);
|
||||||
memset(_map_type_and_height + MapMaxY() * MapSizeX(), MP_VOID << 4, MapSizeX());
|
for (i = 0; i < MapSizeX(); ++i)
|
||||||
|
SetTileType(MapSizeX() * MapMaxY() + i, MP_VOID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255)
|
// since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255)
|
||||||
|
|
Loading…
Reference in New Issue