(svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ

This commit is contained in:
smatz
2009-01-03 17:11:52 +00:00
parent ca4b7b2046
commit cd88a7590a
8 changed files with 23 additions and 17 deletions

View File

@@ -1446,14 +1446,22 @@ bool AfterLoadGame()
/* From this point the old names array is cleared. */
ResetOldNames();
/* no station is determined by 'tile == INVALID_TILE' now (instead of '0') */
if (CheckSavegameVersion(105)) {
if (CheckSavegameVersion(106)) {
/* no station is determined by 'tile == INVALID_TILE' now (instead of '0') */
Station *st;
FOR_ALL_STATIONS(st) {
if (st->airport_tile == 0) st->airport_tile = INVALID_TILE;
if (st->dock_tile == 0) st->dock_tile = INVALID_TILE;
if (st->train_tile == 0) st->train_tile = INVALID_TILE;
}
/* the same applies to Company::location_of_HQ */
Company *c;
FOR_ALL_COMPANIES(c) {
if (c->location_of_HQ == 0 || (CheckSavegameVersion(4) && c->location_of_HQ == 0xFFFF)) {
c->location_of_HQ = INVALID_TILE;
}
}
}
/* convert road side to my format. */