diff --git a/lib/mapObjects/JsonRandom.cpp b/lib/mapObjects/JsonRandom.cpp index a00684cbe..828a890cc 100644 --- a/lib/mapObjects/JsonRandom.cpp +++ b/lib/mapObjects/JsonRandom.cpp @@ -11,6 +11,8 @@ #include "StdInc.h" #include "JsonRandom.h" +#include + #include "../JsonNode.h" #include "../CRandomGenerator.h" #include "../StringConstants.h" @@ -150,7 +152,11 @@ namespace JsonRandom for(const auto & skill : VLC->skillh->objects) { IObjectInterface::cb->isAllowed(2, skill->getIndex()); - defaultSkills.insert(skill->getNameTextID()); + auto scopeAndName = vstd::splitStringToPair(skill->getJsonKey(), ':'); + if(scopeAndName.first == CModHandler::scopeBuiltin() || scopeAndName.first == value.meta) + defaultSkills.insert(scopeAndName.second); + else + defaultSkills.insert(skill->getJsonKey()); } for(const auto & element : value.Vector())