summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
committersmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
commitafef22e3e7caeb41d94115bfd000b4cce68e430d (patch)
tree1b6c7083c14efc8630c4839005e7b1c3c4610160 /src/openttd.cpp
parent6512d717e168fd1a5253a7ebe31e772824131de7 (diff)
downloadopenttd-afef22e3e7caeb41d94115bfd000b4cce68e430d.tar.xz
(svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ
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. */