From c1a2be0d054d0fff7ba49366f385a4ae0a78b229 Mon Sep 17 00:00:00 2001 From: truelight Date: Mon, 7 Feb 2005 19:23:38 +0000 Subject: [PATCH] (svn r1844) -Fix: small protection in oldloader.c, and put the savegame on pause by default --- oldloader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oldloader.c b/oldloader.c index c0d23b5a8d..2461f214bc 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; }