mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix for loading templates from other mods
This commit is contained in:
@@ -218,8 +218,6 @@ std::shared_ptr<ObstacleSet> ObstacleSetHandler::loadFromJson(const std::string
|
|||||||
{
|
{
|
||||||
auto os = std::make_shared<ObstacleSet>();
|
auto os = std::make_shared<ObstacleSet>();
|
||||||
|
|
||||||
// TODO: Register ObstacleSet by its name
|
|
||||||
|
|
||||||
auto biome = json["biome"].Struct();
|
auto biome = json["biome"].Struct();
|
||||||
os->setType(ObstacleSet::typeFromString(biome["objectType"].String()));
|
os->setType(ObstacleSet::typeFromString(biome["objectType"].String()));
|
||||||
|
|
||||||
@@ -236,9 +234,9 @@ std::shared_ptr<ObstacleSet> ObstacleSetHandler::loadFromJson(const std::string
|
|||||||
logGlobal->info("Registering obstacle template: %s in scope %s", node.String(), scope);
|
logGlobal->info("Registering obstacle template: %s in scope %s", node.String(), scope);
|
||||||
|
|
||||||
auto identifier = boost::algorithm::to_lower_copy(node.String());
|
auto identifier = boost::algorithm::to_lower_copy(node.String());
|
||||||
|
auto jsonName = JsonNode(identifier);
|
||||||
|
|
||||||
// FIXME: Identifier 'avlswn02' exists in mod 'hota.mapdecorations' but identifier was explicitly requested from mod 'hota.mapdecorations'!
|
VLC->identifiers()->requestIdentifier(node.getModScope(), "obstacleTemplate", identifier, [this, os](si32 id)
|
||||||
VLC->identifiers()->requestIdentifier(scope, "obstacleTemplate", identifier, [this, os](si32 id)
|
|
||||||
{
|
{
|
||||||
logGlobal->info("Resolved obstacle id: %d", id);
|
logGlobal->info("Resolved obstacle id: %d", id);
|
||||||
os->addObstacle(obstacleTemplates[id]);
|
os->addObstacle(obstacleTemplates[id]);
|
||||||
|
|||||||
Reference in New Issue
Block a user