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_base.h | |
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_base.h')
-rw-r--r-- | src/vehicle_base.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 423da71af..e602cc4ed 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -423,8 +423,9 @@ public: /** * Calls the tick handler of the vehicle + * @return is this vehicle still valid? */ - virtual void Tick() {}; + virtual bool Tick() { return true; }; /** * Calls the new day handler of the vehicle @@ -620,7 +621,7 @@ struct DisasterVehicle : public Vehicle { const char *GetTypeString() const { return "disaster vehicle"; } void UpdateDeltaXY(Direction direction); - void Tick(); + bool Tick(); }; /** @@ -639,7 +640,6 @@ struct InvalidVehicle : public Vehicle { virtual ~InvalidVehicle() {} const char *GetTypeString() const { return "invalid vehicle"; } - void Tick() {} }; #define FOR_ALL_VEHICLES_FROM(v, start) for (v = Vehicle::Get(start); v != NULL; v = (v->index + 1U < Vehicle::GetPoolSize()) ? Vehicle::Get(v->index + 1) : NULL) if (v->IsValid()) |