summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-02-05 17:28:37 +0000
committerfrosch <frosch@openttd.org>2009-02-05 17:28:37 +0000
commit7f198507f724a20bc2c1257ad385a1fa4983a08e (patch)
tree4de4c102c811abe4c55218244a0c848367082bf0 /src/aircraft_cmd.cpp
parent6dff31d34b2df4c1fb1332d33380bb99a2b40924 (diff)
downloadopenttd-7f198507f724a20bc2c1257ad385a1fa4983a08e.tar.xz
(svn r15358) -Add [NoAI]: AIEventVehicleCrashed::GetCrashReason()
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 881f0339d..caf2b0726 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -1323,14 +1323,17 @@ static void CrashAirplane(Vehicle *v)
v->Next()->cargo.Truncate(0);
const Station *st = GetTargetAirportIfValid(v);
StringID newsitem;
+ AIEventVehicleCrashed::CrashReason crash_reason;
if (st == NULL) {
newsitem = STR_PLANE_CRASH_OUT_OF_FUEL;
+ crash_reason = AIEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT;
} else {
SetDParam(1, st->index);
newsitem = STR_A034_PLANE_CRASH_DIE_IN_FIREBALL;
+ crash_reason = AIEventVehicleCrashed::CRASH_PLANE_LANDING;
}
- AI::NewEvent(v->owner, new AIEventVehicleCrashed(v->index, v->tile));
+ AI::NewEvent(v->owner, new AIEventVehicleCrashed(v->index, v->tile, crash_reason));
AddNewsItem(newsitem,
NS_ACCIDENT_VEHICLE,