diff options
author | Darkvater <darkvater@openttd.org> | 2007-01-28 21:53:13 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2007-01-28 21:53:13 +0000 |
commit | 39a50e372361837b00a1a58f1cae697654194e14 (patch) | |
tree | bd54e16fa3f52c728a5bad9311a09b9621fdd4ca /src/vehicle.cpp | |
parent | 00782c089d0a49f1fba31077d079894357926b8d (diff) | |
download | openttd-39a50e372361837b00a1a58f1cae697654194e14.tar.xz |
(svn r8448) -Codechange/Fix (r2993): Also update the helicopter's rotor when loading the game. This can solve crashes when a game is loaded with missing GRF's
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 5ccc1aebc..ab45f792f 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -234,7 +234,16 @@ void AfterLoadVehicles(void) case VEH_Aircraft: if (IsNormalAircraft(v)) { v->cur_image = GetAircraftImage(v, v->direction); - if (v->next != NULL) v->next->cur_image = v->cur_image; + + /* The plane's shadow will have the same image as the plane */ + Vehicle *shadow = v->next; + shadow->cur_image = v->cur_image; + + /* In the case of a helicopter we will update the rotor sprites */ + if (v->subtype == AIR_HELICOPTER) { + Vehicle *rotor = shadow->next; + rotor->cur_image = GetRotorImage(v); + } } break; default: break; |