summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIngo von Borstel <planetmaker@openttd.org>2019-01-16 21:44:03 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-01-19 14:36:15 +0000
commit4e9e115760658099a6dd5a677bdf03145ab93e82 (patch)
tree519fb57c440d95b797b529ae67c675357226d3a8 /src
parentf37304f9f531774f0159e8af013f910bb464e55d (diff)
downloadopenttd-4e9e115760658099a6dd5a677bdf03145ab93e82.tar.xz
Add: [NewGRF] Airport animation trigger for plane landing (#6334, patch by Supercheese)
Diffstat (limited to 'src')
-rw-r--r--src/aircraft_cmd.cpp7
-rw-r--r--src/newgrf_animation_type.h11
2 files changed, 13 insertions, 5 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index b495a1dff..6799f7c64 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -37,6 +37,7 @@
#include "core/backup_type.hpp"
#include "zoom_func.h"
#include "disaster_vehicle.h"
+#include "newgrf_airporttiles.h"
#include "framerate_type.h"
#include "table/strings.h"
@@ -1370,8 +1371,14 @@ static void AircraftEntersTerminal(Aircraft *v)
*/
static void AircraftLandAirplane(Aircraft *v)
{
+ Station *st = Station::Get(v->targetairport);
+
+ TileIndex vt = TileVirtXY(v->x_pos, v->y_pos);
+
v->UpdateDeltaXY();
+ AirportTileAnimationTrigger(st, vt, AAT_STATION_AIRPLANE_LAND);
+
if (!PlayVehicleSound(v, VSE_TOUCHDOWN)) {
SndPlayVehicleFx(SND_17_SKID_PLANE, v);
}
diff --git a/src/newgrf_animation_type.h b/src/newgrf_animation_type.h
index 1f3995f46..8eec6ada9 100644
--- a/src/newgrf_animation_type.h
+++ b/src/newgrf_animation_type.h
@@ -46,11 +46,12 @@ enum IndustryAnimationTrigger {
/** Animation triggers for airport tiles */
enum AirpAnimationTrigger {
- AAT_BUILT, ///< Triggered when the airport is built (for all tiles at the same time).
- AAT_TILELOOP, ///< Triggered in the periodic tile loop.
- AAT_STATION_NEW_CARGO, ///< Triggered when new cargo arrives at the station (for all tiles at the same time).
- AAT_STATION_CARGO_TAKEN, ///< Triggered when a cargo type is completely removed from the station (for all tiles at the same time).
- AAT_STATION_250_TICKS, ///< Triggered every 250 ticks (for all tiles at the same time).
+ AAT_BUILT, ///< Triggered when the airport is built (for all tiles at the same time).
+ AAT_TILELOOP, ///< Triggered in the periodic tile loop.
+ AAT_STATION_NEW_CARGO, ///< Triggered when new cargo arrives at the station (for all tiles at the same time).
+ AAT_STATION_CARGO_TAKEN, ///< Triggered when a cargo type is completely removed from the station (for all tiles at the same time).
+ AAT_STATION_250_TICKS, ///< Triggered every 250 ticks (for all tiles at the same time).
+ AAT_STATION_AIRPLANE_LAND, ///< Triggered when an airplane (not a helicopter) touches down at the airport (for all tiles at the same time).
};
/** Animation triggers for objects. */