diff options
author | frosch <frosch@openttd.org> | 2009-01-27 19:44:36 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-01-27 19:44:36 +0000 |
commit | 9a0d88176b203c02bf4e67bd43a3a5bc3ee22172 (patch) | |
tree | 9bca7c140f273d8118cf91dd362615b924c68ba5 /src/roadveh_cmd.cpp | |
parent | 993ba73aff37375a41d7e7948c8421a20be8934c (diff) | |
download | openttd-9a0d88176b203c02bf4e67bd43a3a5bc3ee22172.tar.xz |
(svn r15286) -Fix: Refitting did not invalidate vehicle-colour-maps of road-vehicles, ships and aircraft, as well vehicle-length of road-vehicles.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 7e587b5be..209801d18 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -47,6 +47,7 @@ #include "core/alloc_func.hpp" #include "table/strings.h" +#include "table/sprites.h" static const uint16 _roadveh_images[63] = { 0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14, @@ -160,6 +161,9 @@ void RoadVehUpdateCache(Vehicle *v) /* Update the length of the vehicle. */ u->u.road.cached_veh_length = GetRoadVehLength(u); + + /* Invalidate the vehicle colour map */ + u->colormap = PAL_NONE; } } @@ -2099,6 +2103,8 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, if (only_this) break; } + if (flags & DC_EXEC) RoadVehUpdateCache(GetVehicle(p1)->First()); + _returned_refit_capacity = total_capacity; return cost; |