diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index f8733066..fad97b97 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -1272,7 +1272,9 @@ void UnitType::sortCommandTypes(CommandTypes cts){ //Cores for(auto &&cc : CommandHelper::getCoresCC()){ - CommandTypeFilter(cts, ctCores, cc); + std::copy_if(cts.begin(), cts.end(), std::back_inserter(ctCores), [cc](CommandType* i) { + return i->getClass() == cc; + }); } int nullCount = 4 - ctCores.size(); for(int i=0; igetClass() == cc) - return true; - else return false; - }); -} - const CommandType* UnitType::findCommandTypeById(int id) const{ const HarvestEmergencyReturnCommandType *result = dynamic_cast(ctHarvestEmergencyReturnCommandType.get()); if(result != NULL && id == result->getId()) { diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index 53e766a2..91f5304d 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -365,7 +365,6 @@ private: void computeFirstStOfClass(); void computeFirstCtOfClass(); void sortCommandTypes(CommandTypes cts); - void CommandTypeFilter(CommandTypes &input, CommandTypes &output, CommandClass cc); }; /**