diff options
author | rubidium <rubidium@openttd.org> | 2007-05-01 16:35:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-01 16:35:14 +0000 |
commit | a4e045a3fbb04a7020d47caf0e2ac41d630df817 (patch) | |
tree | 3af9b32e32882e876dac13b47e51e15d2bba5c06 /src/disaster_cmd.cpp | |
parent | 2ccee752fde0f4ff93c210f0801fefa2848c8ccf (diff) | |
download | openttd-a4e045a3fbb04a7020d47caf0e2ac41d630df817.tar.xz |
(svn r9760) -Codechange: remove the need for saving some vehicle variables.
Diffstat (limited to 'src/disaster_cmd.cpp')
-rw-r--r-- | src/disaster_cmd.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp index c6cc16a05..6b940aed2 100644 --- a/src/disaster_cmd.cpp +++ b/src/disaster_cmd.cpp @@ -116,7 +116,6 @@ static void DisasterVehicleUpdateImage(Vehicle *v) v->cur_image = img; } - /** Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable * and owned by nobody */ static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Direction direction, byte subtype) @@ -128,11 +127,7 @@ static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Directio v->tile = TileVirtXY(x, y); v->direction = direction; v->subtype = subtype; - v->x_offs = -1; - v->y_offs = -1; - v->sprite_width = 2; - v->sprite_height = 2; - v->z_height = 5; + v->UpdateDeltaXY(INVALID_DIR); v->owner = OWNER_NONE; v->vehstatus = VS_UNCLICKABLE; v->u.disaster.image_override = 0; @@ -1065,3 +1060,12 @@ void StartupDisasters() { ResetDisasterDelay(); } + +void DisasterVehicle::UpdateDeltaXY(Direction direction) +{ + this->x_offs = -1; + this->y_offs = -1; + this->sprite_width = 2; + this->sprite_height = 2; + this->z_height = 5; +} |