summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-02-05 17:48:08 +0000
committerfrosch <frosch@openttd.org>2009-02-05 17:48:08 +0000
commit324e92f879980085c773b192ff71e07bd99fd4b0 (patch)
tree23188597be4251815842d4f5b8b075c2aef74958 /src/water_cmd.cpp
parentcb049e4e5816446f7d23fcee43764cb3994780d5 (diff)
downloadopenttd-324e92f879980085c773b192ff71e07bd99fd4b0.tar.xz
(svn r15360) -Fix: Flooding vehicles did not trigger an AI event.
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 9d6921c10..87f22a5ee 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -32,6 +32,7 @@
#include "newgrf_cargo.h"
#include "effectvehicle_func.h"
#include "tunnelbridge_map.h"
+#include "ai/ai.hpp"
#include "table/sprites.h"
#include "table/strings.h"
@@ -838,6 +839,7 @@ static void FloodVehicle(Vehicle *v)
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+ AI::NewEvent(v->owner, new AIEventVehicleCrashed(v->index, v->tile, AIEventVehicleCrashed::CRASH_FLOODED));
SetDParam(0, pass);
AddNewsItem(STR_B006_FLOOD_VEHICLE_DESTROYED,
NS_ACCIDENT_VEHICLE,