(svn r18465) -Codechange: simplify CheckTrainInDepot and remove some unneeded wrapper functions

This commit is contained in:
rubidium
2009-12-11 22:04:57 +00:00
parent 64f1e18830
commit b094312631
3 changed files with 13 additions and 26 deletions

View File

@@ -50,7 +50,6 @@ void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2);
byte FreightWagonMult(CargoID cargo);
int CheckTrainInDepot(const Train *v, bool needs_to_be_stopped);
int CheckTrainStoppedInDepot(const Train *v);
void UpdateTrainAcceleration(Train *v);
void CheckTrainsLengths();
@@ -133,7 +132,7 @@ struct Train : public SpecializedVehicle<Train, VEH_TRAIN> {
Money GetRunningCost() const;
int GetDisplayImageWidth(Point *offset = NULL) const;
bool IsInDepot() const { return CheckTrainInDepot(this, false) != -1; }
bool IsStoppedInDepot() const { return CheckTrainStoppedInDepot(this) >= 0; }
bool IsStoppedInDepot() const { return CheckTrainInDepot(this, true) != -1; }
bool Tick();
void OnNewDay();
uint Crash(bool flooded = false);