Browse Source

vcmi: fix scouting bonus spelling error

With fallback for old mods.
Konstantin 2 years ago
parent
commit
5d4bcb3c78
5 changed files with 9 additions and 6 deletions
  1. 2 2
      config/artifacts.json
  2. 1 1
      config/skills.json
  3. 4 1
      lib/HeroBonus.cpp
  4. 1 1
      lib/HeroBonus.h
  5. 1 1
      lib/mapObjects/CGHeroInstance.cpp

+ 2 - 2
config/artifacts.json

@@ -810,7 +810,7 @@
 	{
 		"bonuses" : [
 			{
-				"type" : "SIGHT_RADIOUS",
+				"type" : "SIGHT_RADIUS",
 				"val" : 1,
 				"valueType" : "BASE_NUMBER"
 			}
@@ -822,7 +822,7 @@
 	{
 		"bonuses" : [
 			{
-				"type" : "SIGHT_RADIOUS",
+				"type" : "SIGHT_RADIUS",
 				"val" : 1,
 				"valueType" : "BASE_NUMBER"
 			}

+ 1 - 1
config/skills.json

@@ -84,7 +84,7 @@
 		"base" : {
 			"effects" : {
 				"main" : {
-					"type" : "SIGHT_RADIOUS",
+					"type" : "SIGHT_RADIUS",
 					"valueType" : "BASE_NUMBER"
 				}
 			}

+ 4 - 1
lib/HeroBonus.cpp

@@ -32,7 +32,10 @@ VCMI_LIB_NAMESPACE_BEGIN
 #define FOREACH_RED_CHILD(pname) 	TNodes lchildren; getRedChildren(lchildren); for(CBonusSystemNode *pname : lchildren)
 
 #define BONUS_NAME(x) { #x, Bonus::x },
-	const std::map<std::string, Bonus::BonusType> bonusNameMap = { BONUS_LIST };
+	const std::map<std::string, Bonus::BonusType> bonusNameMap = {
+		BONUS_LIST
+		{"SIGHT_RADIOUS", Bonus::SIGHT_RADIUS} /*the correct word is RADIUS, but this one's already used in mods. Deprecated. */
+	};
 #undef BONUS_NAME
 
 #define BONUS_VALUE(x) { #x, Bonus::x },

+ 1 - 1
lib/HeroBonus.h

@@ -177,7 +177,7 @@ public:
 	BONUS_NAME(MORALE) \
 	BONUS_NAME(LUCK) \
 	BONUS_NAME(PRIMARY_SKILL) /*uses subtype to pick skill; additional info if set: 1 - only melee, 2 - only distance*/  \
-	BONUS_NAME(SIGHT_RADIOUS) /*the correct word is RADIUS, but this one's already used in mods */\
+	BONUS_NAME(SIGHT_RADIUS) \
 	BONUS_NAME(MANA_REGENERATION) /*points per turn apart from normal (1 + mysticism)*/  \
 	BONUS_NAME(FULL_MANA_REGENERATION) /*all mana points are replenished every day*/  \
 	BONUS_NAME(NONEVIL_ALIGNMENT_MIX) /*good and neutral creatures can be mixed without morale penalty*/  \

+ 1 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -895,7 +895,7 @@ int3 CGHeroInstance::getSightCenter() const
 
 int CGHeroInstance::getSightRadius() const
 {
-	return 5 + valOfBonuses(Bonus::SIGHT_RADIOUS); // scouting gives SIGHT_RADIUS bonus
+	return 5 + valOfBonuses(Bonus::SIGHT_RADIUS); // scouting gives SIGHT_RADIUS bonus
 }
 
 si32 CGHeroInstance::manaRegain() const