Avoid unnecessary calls to InvalidateVehicleTickCaches
Don't call from Train::ConsistChanged
This commit is contained in:
@@ -172,8 +172,6 @@ void Train::ConsistChanged(ConsistChangeFlags allowed_changes)
|
|||||||
|
|
||||||
assert(this->IsFrontEngine() || this->IsFreeWagon());
|
assert(this->IsFrontEngine() || this->IsFreeWagon());
|
||||||
|
|
||||||
InvalidateVehicleTickCaches();
|
|
||||||
|
|
||||||
const RailVehicleInfo *rvi_v = RailVehInfo(this->engine_type);
|
const RailVehicleInfo *rvi_v = RailVehInfo(this->engine_type);
|
||||||
EngineID first_engine = this->IsFrontEngine() ? this->engine_type : INVALID_ENGINE;
|
EngineID first_engine = this->IsFrontEngine() ? this->engine_type : INVALID_ENGINE;
|
||||||
this->gcache.cached_total_length = 0;
|
this->gcache.cached_total_length = 0;
|
||||||
@@ -1010,6 +1008,8 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engin
|
|||||||
}
|
}
|
||||||
|
|
||||||
CheckConsistencyOfArticulatedVehicle(v);
|
CheckConsistencyOfArticulatedVehicle(v);
|
||||||
|
|
||||||
|
InvalidateVehicleTickCaches();
|
||||||
}
|
}
|
||||||
|
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
@@ -1582,6 +1582,8 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
|||||||
RestoreTrainBackup(original_dst);
|
RestoreTrainBackup(original_dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InvalidateVehicleTickCaches();
|
||||||
|
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5214,6 +5216,8 @@ Train* CmdBuildVirtualRailWagon(const Engine *e)
|
|||||||
|
|
||||||
CheckConsistencyOfArticulatedVehicle(v);
|
CheckConsistencyOfArticulatedVehicle(v);
|
||||||
|
|
||||||
|
InvalidateVehicleTickCaches();
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5295,6 +5299,8 @@ Train* CmdBuildVirtualRailVehicle(EngineID eid, bool lax_engine_check, StringID
|
|||||||
|
|
||||||
CheckConsistencyOfArticulatedVehicle(v);
|
CheckConsistencyOfArticulatedVehicle(v);
|
||||||
|
|
||||||
|
InvalidateVehicleTickCaches();
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user