diff options
author | smatz <smatz@openttd.org> | 2009-05-22 13:53:14 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-22 13:53:14 +0000 |
commit | b687ac51ee5e8628ed56319df573c903c0c86ef3 (patch) | |
tree | 26a2219b3bac39dd367deb2de9fcbac64570a93d /src/vehicle.cpp | |
parent | 561d97880d3c2be7d8160f67d18d3e3b85c284e6 (diff) | |
download | openttd-b687ac51ee5e8628ed56319df573c903c0c86ef3.tar.xz |
(svn r16376) -Codechange: Vehicle::Tick() now returns false if the vehicle was deleted
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 5 |
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; |