From 1bea3b55a672185f8e65430af8ec86ff5eef3704 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 1 May 2007 18:17:52 +0000 Subject: (svn r9763) -Codechange/Fix (r9760): don't read the variables that are calculated automatically either. --- src/oldloader.cpp | 8 +++----- src/vehicle.cpp | 20 ++++---------------- 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), -- cgit v1.2.3-70-g09d2