summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorMatt Kimber <github@mattkimber.org.uk>2021-01-03 13:32:58 +0000
committerPatric Stout <github@truebrain.nl>2021-01-05 11:42:25 +0100
commit9b28b15e677e0de64fde270f4223daeb401cfcac (patch)
tree879ebd9b98d9ce4e8a45dd38b9033f3da9349080 /src/train_cmd.cpp
parenteeb88e87d8c7b62e0bac94ede44cceee987b8d09 (diff)
downloadopenttd-9b28b15e677e0de64fde270f4223daeb401cfcac.tar.xz
Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 71fec8cfb..0c4a25eef 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -624,7 +624,7 @@ static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const
v->date_of_last_service = _date;
v->build_year = _cur_year;
- v->sprite_seq.Set(SPR_IMG_QUERY);
+ v->sprite_cache.sprite_seq.Set(SPR_IMG_QUERY);
v->random_bits = VehicleRandomBits();
v->group_id = DEFAULT_GROUP;
@@ -690,7 +690,7 @@ static void AddRearEngineToMultiheadedTrain(Train *v)
u->engine_type = v->engine_type;
u->date_of_last_service = v->date_of_last_service;
u->build_year = v->build_year;
- u->sprite_seq.Set(SPR_IMG_QUERY);
+ u->sprite_cache.sprite_seq.Set(SPR_IMG_QUERY);
u->random_bits = VehicleRandomBits();
v->SetMultiheaded();
u->SetMultiheaded();
@@ -756,7 +756,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engin
v->SetServiceInterval(Company::Get(_current_company)->settings.vehicle.servint_trains);
v->date_of_last_service = _date;
v->build_year = _cur_year;
- v->sprite_seq.Set(SPR_IMG_QUERY);
+ v->sprite_cache.sprite_seq.Set(SPR_IMG_QUERY);
v->random_bits = VehicleRandomBits();
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);