mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r16353) -Fix (r1): invalid read when OTTD savegame contains VEH_INVALID
This commit is contained in:
parent
512db5248e
commit
fe498e21e7
@ -1260,7 +1260,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
|
||||
uint type = ReadByte(ls);
|
||||
switch (type) {
|
||||
default: return false;
|
||||
case 0x00 /* VEH_INVALID */: v = new (_current_vehicle_id) InvalidVehicle(); break;
|
||||
case 0x00 /* VEH_INVALID */: v = new (_current_vehicle_id) InvalidVehicle(); break;
|
||||
case 0x25 /* MONORAIL */:
|
||||
case 0x20 /* VEH_TRAIN */: v = new (_current_vehicle_id) Train(); break;
|
||||
case 0x21 /* VEH_ROAD */: v = new (_current_vehicle_id) RoadVehicle(); break;
|
||||
|
@ -698,7 +698,7 @@ void Load_VEHS()
|
||||
case VEH_AIRCRAFT: v = new (index) Aircraft(); break;
|
||||
case VEH_EFFECT: v = new (index) EffectVehicle(); break;
|
||||
case VEH_DISASTER: v = new (index) DisasterVehicle(); break;
|
||||
case VEH_INVALID: v = new (index) InvalidVehicle(); break;
|
||||
case VEH_INVALID: /* Savegame shouldn't contain invalid vehicles */
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user