(svn r16819) -Fix (r4868): Use the palette of the vehicle being drawn instead of the one of the front vehicle.

This commit is contained in:
frosch
2009-07-13 20:27:54 +00:00
parent 23599a1ed4
commit 3a76b9be2b

View File

@@ -240,7 +240,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
u = v; u = v;
do { do {
SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); SpriteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
DrawSprite(u->GetImage(DIR_W), pal, x + WagonLengthToPixels(4 + dx), y + 6 + (is_custom_sprite(RailVehInfo(u->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0)); DrawSprite(u->GetImage(DIR_W), pal, x + WagonLengthToPixels(4 + dx), y + 6 + (is_custom_sprite(RailVehInfo(u->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0));
dx += Train::From(u)->tcache.cached_veh_length; dx += Train::From(u)->tcache.cached_veh_length;
u = u->Next(); u = u->Next();