summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-03-06 12:50:55 +0000
committerterkhen <terkhen@openttd.org>2010-03-06 12:50:55 +0000
commit4e6cac84d6d30ea07fe7035f76085f8b0b55df78 (patch)
treeb16c3b54612de1357bcd3859fbab8dc183990617 /src/saveload
parent1c3b7c35a7efbd05da32c97d0a6b4fc49fed087a (diff)
downloadopenttd-4e6cac84d6d30ea07fe7035f76085f8b0b55df78.tar.xz
(svn r19341) -Codechange: Move GOINGUP/GOINGDOWN flags to GroundVehicle.
-Codechange: Move GetSlopeResistance to GroundVehicle.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp12
-rw-r--r--src/saveload/vehicle_sl.cpp1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index e4069b1bb..d2b886c6d 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2072,6 +2072,18 @@ bool AfterLoadGame()
st->airport.h = st->GetAirportSpec()->size_y;
}
}
+
+ Train *t;
+ FOR_ALL_TRAINS(t) {
+ /* Copy old GOINGUP / GOINGDOWN flags. */
+ if (HasBit(t->flags, 1)) {
+ ClrBit(t->flags, 1);
+ SetBit(t->gv_flags, GVF_GOINGUP_BIT);
+ } else if (HasBit(t->flags, 2)) {
+ ClrBit(t->flags, 2);
+ SetBit(t->gv_flags, GVF_GOINGDOWN_BIT);
+ }
+ }
}
/* Road stops is 'only' updating some caches */
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 70ce2e1f3..15782f524 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -544,6 +544,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
SLE_CONDVAR(Train, wait_counter, SLE_UINT16, 136, SL_MAX_VERSION),
SLE_CONDNULL(2, 2, 19),
+ SLE_CONDVAR(Train, gv_flags, SLE_UINT16, 139, SL_MAX_VERSION),
/* reserve extra space in savegame here. (currently 11 bytes) */
SLE_CONDNULL(11, 2, SL_MAX_VERSION),