Refactor CallVehicleTicks vehicle loop

This commit is contained in:
Jonathan G Rennison
2019-01-25 20:17:15 +00:00
parent 5995e825bc
commit e5b61e0b6c
14 changed files with 230 additions and 99 deletions

View File

@@ -332,6 +332,8 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
v->UpdatePosition();
CheckConsistencyOfArticulatedVehicle(v);
InvalidateVehicleTickCaches();
}
return CommandCost();
@@ -1665,10 +1667,6 @@ Money RoadVehicle::GetRunningCost() const
bool RoadVehicle::Tick()
{
PerformanceAccumulator framerate(PFE_GL_ROADVEHS);
this->tick_counter++;
if (this->IsFrontEngine()) {
if (!(this->IsRoadVehicleStopped())) this->running_ticks++;
return RoadVehController(this);