From 4800e4727030ea296573c87a2acfa28f4e47d56b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 21 Jan 2017 01:17:36 +0000 Subject: [PATCH] TBTR: Remove partial implementation of all-group replacement. --- src/tbtr_template_vehicle_func.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/tbtr_template_vehicle_func.cpp b/src/tbtr_template_vehicle_func.cpp index aeb47d0e24..c108342c4f 100644 --- a/src/tbtr_template_vehicle_func.cpp +++ b/src/tbtr_template_vehicle_func.cpp @@ -213,22 +213,13 @@ Train* DeleteVirtualTrain(Train *chain, Train *to_del) { // retrieve template vehicle from templatereplacement that belongs to the given group TemplateVehicle* GetTemplateVehicleByGroupID(GroupID gid) { + if (gid >= NEW_GROUP) return NULL; TemplateReplacement *tr; - // first try to find a templatereplacement issued for the given groupid FOR_ALL_TEMPLATE_REPLACEMENTS(tr) { if (tr->Group() == gid) { return TemplateVehicle::GetIfValid(tr->Template()); // there can be only one } } - // if that didn't work, try to find a templatereplacement for ALL_GROUP - if (gid != ALL_GROUP) { - FOR_ALL_TEMPLATE_REPLACEMENTS(tr) { - if (tr->Group() == ALL_GROUP) { - return TemplateVehicle::GetIfValid(tr->Template()); - } - } - } - // if all failed, just return null return NULL; }