Browse Source

Fixed moat identifiers requests - will now always request spells

Ivan Savenko 2 years ago
parent
commit
191959ae05

+ 1 - 1
config/factions/castle.json

@@ -147,7 +147,7 @@
 			"horde" : [ 2, -1 ],
 			"mageGuild" : 4,
 			"warMachine" : "ballista",
-			"moatAbility" : "core:spell.castleMoat",
+			"moatAbility" : "castleMoat",
 			// primaryResource not specified so town get both Wood and Ore for resource bonus
 
 			"buildings" :

+ 1 - 1
config/factions/conflux.json

@@ -152,7 +152,7 @@
 			"mageGuild" : 5,
 			"primaryResource" : "mercury",
 			"warMachine" : "ballista",
-			"moatAbility" : "core:spell.castleMoat",
+			"moatAbility" : "castleMoat",
 
 			"buildings" :
 			{

+ 1 - 1
config/factions/dungeon.json

@@ -148,7 +148,7 @@
 			"mageGuild" : 5,
 			"primaryResource" : "sulfur",
 			"warMachine" : "ballista",
-			"moatAbility" : "core:spell.dungeonMoat",
+			"moatAbility" : "dungeonMoat",
 
 
 			"buildings" :

+ 1 - 1
config/factions/fortress.json

@@ -147,7 +147,7 @@
 			"horde" : [ 0, -1 ],
 			"mageGuild" : 3,
 			"warMachine" : "firstAidTent",
-			"moatAbility" : "core:spell.fortressMoat",
+			"moatAbility" : "fortressMoat",
 			// primaryResource not specified so town get both Wood and Ore for resource bonus
 
 			"buildings" :

+ 1 - 1
config/factions/inferno.json

@@ -149,7 +149,7 @@
 			"mageGuild" : 5,
 			"primaryResource" : "mercury",
 			"warMachine" : "ammoCart",
-			"moatAbility" : "core:spell.infernoMoat",
+			"moatAbility" : "infernoMoat",
 
 			"buildings" :
 			{

+ 1 - 1
config/factions/necropolis.json

@@ -152,7 +152,7 @@
 			"horde" : [ 0, -1 ],
 			"mageGuild" : 5,
 			"warMachine" : "firstAidTent",
-			"moatAbility" : "core:spell.necropolisMoat",
+			"moatAbility" : "necropolisMoat",
 			// primaryResource not specified so town get both Wood and Ore for resource bonus
 
 			"buildings" :

+ 1 - 1
config/factions/rampart.json

@@ -152,7 +152,7 @@
 			"mageGuild" : 5,
 			"primaryResource" : "crystal",
 			"warMachine" : "firstAidTent",
-			"moatAbility" : "core:spell.rampartMoat",
+			"moatAbility" : "rampartMoat",
 
 			"buildings" :
 			{

+ 1 - 1
config/factions/stronghold.json

@@ -145,7 +145,7 @@
 			"horde" : [ 0, -1 ],
 			"mageGuild" : 3,
 			"warMachine" : "ammoCart",
-			"moatAbility" : "core:spell.strongholdMoat",
+			"moatAbility" : "strongholdMoat",
 			// primaryResource not specified so town get both Wood and Ore for resource bonus
 
 			"buildings" :

+ 1 - 1
config/factions/tower.json

@@ -147,7 +147,7 @@
 			"primaryResource" : "gems",
 			"mageGuild" : 5,
 			"warMachine" : "ammoCart",
-			"moatAbility" : "core:spell.towerMoat",
+			"moatAbility" : "towerMoat",
 
 			"buildings" :
 			{

+ 6 - 3
lib/CTownHandler.cpp

@@ -885,10 +885,13 @@ void CTownHandler::loadTown(CTown * town, const JsonNode & source)
 		town->namesCount += 1;
 	}
 
-	VLC->modh->identifiers.requestIdentifier(source["moatAbility"], [=](si32 ability)
+	if (!source["moatAbility"].isNull()) // VCMI 1.2 compatibility code
 	{
-		town->moatAbility = SpellID(ability);
-	});
+		VLC->modh->identifiers.requestIdentifier( "spell", source["moatAbility"], [=](si32 ability)
+		{
+			town->moatAbility = SpellID(ability);
+		});
+	}
 
 	//  Horde building creature level
 	for(const JsonNode &node : source["horde"].Vector())