diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index ee7b3e03..b7a63a3f 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -1286,7 +1286,9 @@ void UnitType::sortCommandTypes(CommandTypes cts){ ctCores.resize(4); for(int i = (int)ctToBasics.size(); i --> 0; ) {// we push it to basics ctBasics[basicNulls[i]] = ctToBasics[i]; - basicNulls.erase(basicNulls.begin() + i); + if(i < (int)basicNulls.size()) + basicNulls.erase(basicNulls.begin() + i); + else printf("Unit: %s have too match core commands \n", this->getName().c_str()); } }