diff options
author | rubidium <rubidium@openttd.org> | 2010-09-16 22:06:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-09-16 22:06:36 +0000 |
commit | 97dbb1f27d6e1cad6be0b53f74a88694562f1331 (patch) | |
tree | ce1f613fc78678b0d5c54ff939b14563f1b55a1b /src/saveload/oldloader_sl.cpp | |
parent | 5b733f88a8f05c84d3e0ce7a19c3c9c79054657f (diff) | |
download | openttd-97dbb1f27d6e1cad6be0b53f74a88694562f1331.tar.xz |
(svn r20819) -Fix [FS#3714]: be a bit more "lenient" w.r.t. invalid savegames; don't crash on saveload related NOT_REACHEDs, just show the user an error that the savegame is corrupted
Diffstat (limited to 'src/saveload/oldloader_sl.cpp')
-rw-r--r-- | src/saveload/oldloader_sl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 1088d3822..59e18bf6f 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -1095,7 +1095,7 @@ static bool LoadOldVehicleUnion(LoadgameState *ls, int num) res = LoadChunk(ls, NULL, vehicle_empty_chunk); } else { switch (v->type) { - default: NOT_REACHED(); + default: SlErrorCorrupt("Invalid vehicle type"); case VEH_TRAIN : res = LoadChunk(ls, v, vehicle_train_chunk); break; case VEH_ROAD : res = LoadChunk(ls, v, vehicle_road_chunk); break; case VEH_SHIP : res = LoadChunk(ls, v, vehicle_ship_chunk); break; @@ -1295,7 +1295,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num) } else { /* Read the vehicle type and allocate the right vehicle */ switch (ReadByte(ls)) { - default: NOT_REACHED(); + default: SlErrorCorrupt("Invalid vehicle type"); case 0x00 /* VEH_INVALID */: v = NULL; break; case 0x10 /* VEH_TRAIN */: v = new (_current_vehicle_id) Train(); break; case 0x11 /* VEH_ROAD */: v = new (_current_vehicle_id) RoadVehicle(); break; |