mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-09 19:10:38 +00:00
(svn r1417) Fix: The invisible tiles on the southern border are now converted to class MP_VOID when an old map (with wrong classified invisible tiles) is loaded.
I bumped the minor savegame version for that, even though it's not really necessary. We're not gonna run out of minor savegame versions anyway though. ;)
This commit is contained in:
parent
76c7f3b14e
commit
b78b576b21
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
SAVEGAME_MAJOR_VERSION = 4,
|
SAVEGAME_MAJOR_VERSION = 4,
|
||||||
SAVEGAME_MINOR_VERSION = 2,
|
SAVEGAME_MINOR_VERSION = 3,
|
||||||
|
|
||||||
SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION
|
SAVEGAME_LOADABLE_VERSION = (SAVEGAME_MAJOR_VERSION << 8) + SAVEGAME_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
16
ttd.c
16
ttd.c
@ -1238,6 +1238,17 @@ void UpdateCurrencies()
|
|||||||
_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
|
||||||
|
// even though they should have. This is fixed by this function
|
||||||
|
void UpdateVoidTiles()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
// create void tiles on the border
|
||||||
|
for (i = 0; i != MapMaxY(); i++)
|
||||||
|
_map_type_and_height[ i * MapSizeX() + MapMaxY() ] = MP_VOID << 4;
|
||||||
|
memset(_map_type_and_height + MapMaxY() * MapSizeX(), MP_VOID << 4, MapSizeX());
|
||||||
|
}
|
||||||
|
|
||||||
extern void UpdateOldAircraft();
|
extern void UpdateOldAircraft();
|
||||||
|
|
||||||
bool AfterLoadGame(uint version)
|
bool AfterLoadGame(uint version)
|
||||||
@ -1328,6 +1339,10 @@ bool AfterLoadGame(uint version)
|
|||||||
CheckIsPlayerActive();
|
CheckIsPlayerActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the void tiles on the southern border used to belong to a wrong class.
|
||||||
|
if (version <= 0x402)
|
||||||
|
UpdateVoidTiles();
|
||||||
|
|
||||||
// If Load Scenario / New (Scenario) Game is used,
|
// If Load Scenario / New (Scenario) Game is used,
|
||||||
// a player does not exist yet. So create one here.
|
// a player does not exist yet. So create one here.
|
||||||
// 1 exeption: network-games. Those can have 0 players
|
// 1 exeption: network-games. Those can have 0 players
|
||||||
@ -1341,7 +1356,6 @@ bool AfterLoadGame(uint version)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DebugProc(int i)
|
void DebugProc(int i)
|
||||||
{
|
{
|
||||||
switch(i) {
|
switch(i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user