diff options
author | rubidium <rubidium@openttd.org> | 2007-10-16 19:27:24 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-16 19:27:24 +0000 |
commit | 8c33d938cb7150e7dcfcdd75d35817761e12a395 (patch) | |
tree | bfefaf16803d67ac87f3a781c30622a53a30de4f | |
parent | cba9def0ba0a2f29acd42ff11d0167b552161b90 (diff) | |
download | openttd-8c33d938cb7150e7dcfcdd75d35817761e12a395.tar.xz |
(svn r11275) -Fix: oldloader crashing when referencing a vehicle that is not yet loaded.
-rw-r--r-- | src/oldloader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 0f39e2600..f3d394bd1 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -1231,7 +1231,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num) default: v->spritenum >>= 1; break; } - if (_old_next_ptr != 0xFFFF) v->next = GetVehicle(_old_next_ptr); + if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr); v->string_id = RemapOldStringID(_old_string_id); |