summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index e449a03f5..2127d6aec 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -604,7 +604,10 @@ void CallVehicleTicks()
Vehicle *v;
FOR_ALL_VEHICLES(v) {
- v->Tick();
+ /* Vehicle could be deleted in this tick */
+ if (!v->Tick()) continue;
+
+ assert(v->IsValid());
switch (v->type) {
default: break;