Changeset - r19464:9f131ef157fd
[Not reviewed]
master
0 2 0
frosch - 12 years ago 2012-07-07 15:22:21
frosch@openttd.org
(svn r24381) -Revert (r24380): RoadVehicle::IsInDepot was supposed to behave different to Train::IsInDepot.
2 files changed with 3 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/roadveh.h
Show inline comments
 
@@ -112,7 +112,7 @@ struct RoadVehicle FINAL : public Ground
 
	int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed / 2; }
 
	Money GetRunningCost() const;
 
	int GetDisplayImageWidth(Point *offset = NULL) const;
 
	bool IsInDepot() const;
 
	bool IsInDepot() const { return this->state == RVSB_IN_DEPOT; }
 
	bool IsStoppedInDepot() const;
 
	bool Tick();
 
	void OnNewDay();
src/roadveh_cmd.cpp
Show inline comments
 
@@ -308,15 +308,10 @@ CommandCost CmdBuildRoadVehicle(TileInde
 

	
 
bool RoadVehicle::IsStoppedInDepot() const
 
{
 
	if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false;
 

	
 
	return this->IsInDepot();
 
}
 
	TileIndex tile = this->tile;
 

	
 
bool RoadVehicle::IsInDepot() const
 
{
 
	TileIndex tile = this->tile;
 
	if (!IsRoadDepotTile(tile)) return false;
 
	if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false;
 

	
 
	for (const RoadVehicle *v = this; v != NULL; v = v->Next()) {
 
		if (v->state != RVSB_IN_DEPOT || v->tile != tile) return false;
0 comments (0 inline, 0 general)