summaryrefslogtreecommitdiff
path: root/src/saveload.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-03 13:52:06 +0000
committerrubidium <rubidium@openttd.org>2009-01-03 13:52:06 +0000
commit0d54db5f9fb3a3987f908645ca9693684f34674b (patch)
treed7251708eeba7b26d032505b22c0bb570da26501 /src/saveload.cpp
parentfa2bf69a5384a8035a92a069f47f31a178bc3f3c (diff)
downloadopenttd-0d54db5f9fb3a3987f908645ca9693684f34674b.tar.xz
(svn r14803) -Codechange: move order list management into it's own class and remove the order count from the savegame as we can easily count that (PhilSophus)
Diffstat (limited to 'src/saveload.cpp')
-rw-r--r--src/saveload.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/saveload.cpp b/src/saveload.cpp
index a5de05b06..ebbba0edf 100644
--- a/src/saveload.cpp
+++ b/src/saveload.cpp
@@ -39,7 +39,7 @@
#include "table/strings.h"
-extern const uint16 SAVEGAME_VERSION = 104;
+extern const uint16 SAVEGAME_VERSION = 105;
SavegameType _savegame_type; ///< type of savegame we are loading
@@ -1367,6 +1367,7 @@ static uint ReferenceToInt(const void *obj, SLRefType rt)
case REF_ROADSTOPS: return ((const RoadStop*)obj)->index + 1;
case REF_ENGINE_RENEWS: return ((const EngineRenew*)obj)->index + 1;
case REF_CARGO_PACKET: return ((const CargoPacket*)obj)->index + 1;
+ case REF_ORDERLIST: return ((const OrderList*)obj)->index + 1;
default: NOT_REACHED();
}
@@ -1399,6 +1400,10 @@ static void *IntToReference(uint index, SLRefType rt)
index--; // correct for the NULL index
switch (rt) {
+ case REF_ORDERLIST:
+ if (_OrderList_pool.AddBlockIfNeeded(index)) return GetOrderList(index);
+ error("Orders: failed loading savegame: too many order lists");
+
case REF_ORDER:
if (_Order_pool.AddBlockIfNeeded(index)) return GetOrder(index);
error("Orders: failed loading savegame: too many orders");