1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

Fix crash on using two mods that add battlefield with same identifier

This commit is contained in:
Ivan Savenko 2024-01-05 15:58:25 +02:00
parent b5307948c5
commit fbdceb4f71
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ BattleFieldInfo * BattleFieldHandler::loadFromJson(const std::string & scope, co
auto * info = new BattleFieldInfo(BattleField(index), identifier);
info->modScope = scope;
info->graphics = ImagePath::fromJson(json["graphics"]);
info->icon = json["icon"].String();
info->name = json["name"].String();
@ -66,7 +67,7 @@ int32_t BattleFieldInfo::getIconIndex() const
std::string BattleFieldInfo::getJsonKey() const
{
return identifier;
return modScope + ':' + identifier;
}
std::string BattleFieldInfo::getNameTextID() const

View File

@ -27,6 +27,7 @@ public:
bool isSpecial;
ImagePath graphics;
std::string name;
std::string modScope;
std::string identifier;
std::string icon;
si32 iconIndex;