diff --git a/lib/mapObjectConstructors/AObjectTypeHandler.cpp b/lib/mapObjectConstructors/AObjectTypeHandler.cpp index 85c2aaef6..c431900aa 100644 --- a/lib/mapObjectConstructors/AObjectTypeHandler.cpp +++ b/lib/mapObjectConstructors/AObjectTypeHandler.cpp @@ -29,6 +29,11 @@ std::string AObjectTypeHandler::getJsonKey() const return modScope + ':' + subTypeName; } +std::string AObjectTypeHandler::getModScope() const +{ + return modScope; +} + si32 AObjectTypeHandler::getIndex() const { return type; diff --git a/lib/mapObjectConstructors/AObjectTypeHandler.h b/lib/mapObjectConstructors/AObjectTypeHandler.h index d555244b2..402aa2aec 100644 --- a/lib/mapObjectConstructors/AObjectTypeHandler.h +++ b/lib/mapObjectConstructors/AObjectTypeHandler.h @@ -74,6 +74,8 @@ public: /// returns full form of identifier of this object in form of modName:objectName std::string getJsonKey() const; + std::string getModScope() const; + /// Returns object-specific name, if set SObjectSounds getSounds() const; diff --git a/mapeditor/mapcontroller.cpp b/mapeditor/mapcontroller.cpp index f09eb22d1..a855f82b7 100644 --- a/mapeditor/mapcontroller.cpp +++ b/mapeditor/mapcontroller.cpp @@ -624,7 +624,7 @@ ModCompatibilityInfo MapController::modAssessmentMap(const CMap & map) for(auto obj : map.objects) { auto handler = obj->getObjectHandler(); - auto modScope = QString::fromStdString(handler->getJsonKey()).split(":").at(0).toStdString(); + auto modScope = handler->getModScope(); if(modScope != "core") result[modScope] = VLC->modh->getModInfo(modScope).getVerificationInfo();