diff options
author | frosch <frosch@openttd.org> | 2016-10-16 14:57:13 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-10-16 14:57:13 +0000 |
commit | f5409c713b002012c6a2218de1720a91282eab67 (patch) | |
tree | dcd78c4add1c6237ddc36fb52393b780edee2531 /src/vehicle_gui.cpp | |
parent | 7c4e5242ba77635c6e4aee4075d7e9a6c02ac09c (diff) | |
download | openttd-f5409c713b002012c6a2218de1720a91282eab67.tar.xz |
(svn r27665) -Fix: When dragging crashed vehicles, also draw them as crashed at the mouse cursor.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 021c56294..87c119074 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2881,8 +2881,10 @@ void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type) if (_cursor.sprite_count == lengthof(_cursor.sprite_seq)) break; if (total_width >= 2 * (int)VEHICLEINFO_FULL_VEHICLE_WIDTH) break; + PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); + _cursor.sprite_seq[_cursor.sprite_count].sprite = v->GetImage(rtl ? DIR_E : DIR_W, image_type); - _cursor.sprite_seq[_cursor.sprite_count].pal = GetVehiclePalette(v); + _cursor.sprite_seq[_cursor.sprite_count].pal = pal; _cursor.sprite_pos[_cursor.sprite_count].x = rtl ? -total_width : total_width; _cursor.sprite_pos[_cursor.sprite_count].y = 0; |