summaryrefslogtreecommitdiff
path: root/src/oldloader.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/oldloader.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/oldloader.cpp')
-rw-r--r--src/oldloader.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 2e072b76d..a94824978 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -329,12 +329,9 @@ static StringID *_old_vehicle_names = NULL;
static void FixOldVehicles()
{
- /* Check for shared orders, and link them correctly */
Vehicle* v;
FOR_ALL_VEHICLES(v) {
- Vehicle *u;
-
v->name = CopyFromOldName(_old_vehicle_names[v->index]);
/* We haven't used this bit for stations for ages */
@@ -356,14 +353,7 @@ static void FixOldVehicles()
v->current_order.MakeDummy();
}
- FOR_ALL_VEHICLES_FROM(u, v->index + 1) {
- /* If a vehicle has the same orders, add the link to eachother
- * in both vehicles */
- if (v->orders == u->orders) {
- u->AddToShared(v);
- break;
- }
- }
+ /* Shared orders are fixed in AfterLoadVehicles now */
}
}
@@ -1144,7 +1134,7 @@ static const OldChunks vehicle_chunk[] = {
OCL_VAR ( OC_UINT32, 1, &_old_order_ptr ),
OCL_VAR ( OC_UINT16, 1, &_old_order ),
- OCL_SVAR( OC_UINT8, Vehicle, num_orders ),
+ OCL_NULL ( 1 ), ///< num_orders, now calculated
OCL_SVAR( OC_UINT8, Vehicle, cur_order_index ),
OCL_SVAR( OC_TILE, Vehicle, dest_tile ),
OCL_SVAR( OC_UINT16, Vehicle, load_unload_time_rem ),
@@ -1250,7 +1240,7 @@ bool LoadOldVehicle(LoadgameState *ls, int num)
* we go over that limit something is very wrong. In that case
* we just assume there are no orders for the vehicle.
*/
- if (old_id < 5000) v->orders = GetOrder(old_id);
+ if (old_id < 5000) v->orders.old = GetOrder(old_id);
}
v->current_order.AssignOrder(UnpackOldOrder(_old_order));