summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 6bb681788..ec2eeb209 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -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. */