summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-07 19:23:38 +0000
committertruelight <truelight@openttd.org>2005-02-07 19:23:38 +0000
commit034dac2c85d96f59a9ae1bd6032478a548809d99 (patch)
treebe76e267d1470d42dd61c0e0a897ad9ec696749a
parenta3d2b0e66dc41a15871fe6c3b326355ed346a47c (diff)
downloadopenttd-034dac2c85d96f59a9ae1bd6032478a548809d99.tar.xz
(svn r1844) -Fix: small protection in oldloader.c, and put the savegame on pause by default
-rw-r--r--oldloader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/oldloader.c b/oldloader.c
index c0d23b5a8..2461f214b 100644
--- a/oldloader.c
+++ b/oldloader.c
@@ -1269,6 +1269,12 @@ static bool LoadOldVehicle(LoadgameState *ls, int num)
if (!LoadChunk(ls, v, vehicle_chunk))
return false;
+ /* This should be consistent, else we have a big problem... */
+ if (v->index != _current_vehicle_id) {
+ DEBUG(oldloader, 0)("[OldLoader] -- Loading failed - vehicle-array is invalid");
+ return false;
+ }
+
if (_old_order_ptr != 0 && _old_order_ptr != 0xFFFFFFFF) {
v->orders = GetOrder(REMAP_ORDER_IDX(_old_order_ptr));
}
@@ -1614,6 +1620,8 @@ bool LoadOldSaveGame(const char *file)
fclose(_ls.file);
+ _pause = 2;
+
return true;
}