diff options
-rw-r--r-- | src/vehicle.cpp | 11 | ||||
-rw-r--r-- | src/vehicle.h | 1 |
2 files changed, 11 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; diff --git a/src/vehicle.h b/src/vehicle.h index 2b7773ced..8719ba91d 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -296,6 +296,7 @@ int GetTrainImage(const Vehicle* v, Direction direction); int GetAircraftImage(const Vehicle* v, Direction direction); int GetRoadVehImage(const Vehicle* v, Direction direction); int GetShipImage(const Vehicle* v, Direction direction); +SpriteID GetRotorImage(const Vehicle *v); Vehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicle type); Vehicle *CreateEffectVehicleAbove(int x, int y, int z, EffectVehicle type); |