summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-01 18:17:52 +0000
committerrubidium <rubidium@openttd.org>2007-05-01 18:17:52 +0000
commitdfe7c5cd667ce406866c84f46fa841c15d1d83ec (patch)
tree650ad89010f7408fa15e5de389b3761b869d356f
parent7de20df3791e86c0692b05f94a68b96f45bc7a33 (diff)
downloadopenttd-dfe7c5cd667ce406866c84f46fa841c15d1d83ec.tar.xz
(svn r9763) -Codechange/Fix (r9760): don't read the variables that are calculated automatically either.
-rw-r--r--src/oldloader.cpp8
-rw-r--r--src/vehicle.cpp20
2 files changed, 7 insertions, 21 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index ed8e5ee68..7ac69d4dd 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1116,11 +1116,9 @@ static const OldChunks vehicle_chunk[] = {
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Vehicle, y_pos ),
OCL_SVAR( OC_UINT8, Vehicle, z_pos ),
OCL_SVAR( OC_UINT8, Vehicle, direction ),
- OCL_SVAR( OC_INT8, Vehicle, x_offs ),
- OCL_SVAR( OC_INT8, Vehicle, y_offs ),
- OCL_SVAR( OC_UINT8, Vehicle, sprite_width ),
- OCL_SVAR( OC_UINT8, Vehicle, sprite_height ),
- OCL_SVAR( OC_UINT8, Vehicle, z_height ),
+ OCL_NULL( 2 ), ///< x_offs and y_offs, calculated automatically
+ OCL_NULL( 2 ), ///< sprite_width and sprite_height, calculated automatically
+ OCL_NULL( 1 ), ///< z_height, calculated automatically
OCL_SVAR( OC_UINT8, Vehicle, owner ),
OCL_SVAR( OC_TILE, Vehicle, tile ),
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 4cbb4887f..143f1fc36 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2645,13 +2645,9 @@ extern const SaveLoad _common_veh_desc[] = {
SLE_VAR(Vehicle, z_pos, SLE_UINT8),
SLE_VAR(Vehicle, direction, SLE_UINT8),
- SLE_CONDVAR(Vehicle, cur_image, SLE_UINT16, 0, 57),
+ SLE_CONDNULL(2, 0, 57),
SLE_VAR(Vehicle, spritenum, SLE_UINT8),
- SLE_CONDVAR(Vehicle, sprite_width, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, sprite_height, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, z_height, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, x_offs, SLE_INT8, 0, 57),
- SLE_CONDVAR(Vehicle, y_offs, SLE_INT8, 0, 57),
+ SLE_CONDNULL(5, 0, 57),
SLE_VAR(Vehicle, engine_type, SLE_UINT16),
SLE_VAR(Vehicle, max_speed, SLE_UINT16),
@@ -2819,11 +2815,7 @@ static const SaveLoad _special_desc[] = {
SLE_VAR(Vehicle, z_pos, SLE_UINT8),
SLE_VAR(Vehicle, cur_image, SLE_UINT16),
- SLE_CONDVAR(Vehicle, sprite_width, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, sprite_height, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, z_height, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, x_offs, SLE_INT8, 0, 57),
- SLE_CONDVAR(Vehicle, y_offs, SLE_INT8, 0, 57),
+ SLE_CONDNULL(5, 0, 57),
SLE_VAR(Vehicle, progress, SLE_UINT8),
SLE_VAR(Vehicle, vehstatus, SLE_UINT8),
@@ -2854,11 +2846,7 @@ static const SaveLoad _disaster_desc[] = {
SLE_VAR(Vehicle, z_pos, SLE_UINT8),
SLE_VAR(Vehicle, direction, SLE_UINT8),
- SLE_CONDVAR(Vehicle, x_offs, SLE_INT8, 0, 57),
- SLE_CONDVAR(Vehicle, y_offs, SLE_INT8, 0, 57),
- SLE_CONDVAR(Vehicle, sprite_width, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, sprite_height, SLE_UINT8, 0, 57),
- SLE_CONDVAR(Vehicle, z_height, SLE_UINT8, 0, 57),
+ SLE_CONDNULL(5, 0, 57),
SLE_VAR(Vehicle, owner, SLE_UINT8),
SLE_VAR(Vehicle, vehstatus, SLE_UINT8),
SLE_CONDVARX(cpp_offsetof(Vehicle, current_order) + cpp_offsetof(Order, dest), SLE_FILE_U8 | SLE_VAR_U16, 0, 4),