TBTR: Avoid unnecessary iterations of template replacement pool

This commit is contained in:
Jonathan G Rennison
2020-01-16 01:16:08 +00:00
parent 5a3b67c5c3
commit 424813446f
7 changed files with 62 additions and 24 deletions

View File

@@ -1069,8 +1069,7 @@ void Vehicle::PreCleanPool()
void VehicleEnteredDepotThisTick(Vehicle *v)
{
/* Template Replacement Setup stuff */
TemplateReplacement *tr = GetTemplateReplacementByGroupID(v->group_id);
if (tr != nullptr) {
if (GetTemplateIDByGroupID(v->group_id) != INVALID_TEMPLATE) {
/* Vehicle should stop in the depot if it was in 'stopping' state */
_vehicles_to_templatereplace.insert(v->index);
}