summaryrefslogtreecommitdiff
path: root/src/disaster_vehicle.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-10-16 14:57:56 +0000
committerfrosch <frosch@openttd.org>2016-10-16 14:57:56 +0000
commitd2393b4f6c89b75a90452fe68ab8a1cfbd8c353f (patch)
treec7934b2d2a19fa55c53ac063b91cc519fb4b753a /src/disaster_vehicle.cpp
parentf5409c713b002012c6a2218de1720a91282eab67 (diff)
downloadopenttd-d2393b4f6c89b75a90452fe68ab8a1cfbd8c353f.tar.xz
(svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq.
Diffstat (limited to 'src/disaster_vehicle.cpp')
-rw-r--r--src/disaster_vehicle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp
index d75e2d460..65a9187e3 100644
--- a/src/disaster_vehicle.cpp
+++ b/src/disaster_vehicle.cpp
@@ -112,7 +112,7 @@ void DisasterVehicle::UpdateImage()
{
SpriteID img = this->image_override;
if (img == 0) img = _disaster_images[this->subtype][this->direction];
- this->cur_image = img;
+ this->sprite_seq.Set(img);
}
/**
@@ -499,7 +499,8 @@ static bool DisasterTick_Helicopter_Rotors(DisasterVehicle *v)
v->tick_counter++;
if (HasBit(v->tick_counter, 0)) return true;
- if (++v->cur_image > SPR_ROTOR_MOVING_3) v->cur_image = SPR_ROTOR_MOVING_1;
+ SpriteID &cur_image = v->sprite_seq.sprite;
+ if (++cur_image > SPR_ROTOR_MOVING_3) cur_image = SPR_ROTOR_MOVING_1;
v->UpdatePositionAndViewport();