瀏覽代碼

Fixed typo bonus duration enum. Mod compatibility retained.

AlexVinS 9 年之前
父節點
當前提交
245d17a9e9
共有 4 個文件被更改,包括 12 次插入11 次删除
  1. 5 5
      config/spells/ability.json
  2. 3 3
      config/spells/timed.json
  3. 2 1
      lib/HeroBonus.cpp
  4. 2 2
      lib/HeroBonus.h

+ 5 - 5
config/spells/ability.json

@@ -18,14 +18,14 @@
 						"type" : "NOT_ACTIVE",
 						"subtype" : 62,
 						"duration" : [
-							"UNITL_BEING_ATTACKED",
+							"UNTIL_BEING_ATTACKED",
 							"N_TURNS"
 						]
 					},
 					"noRetaliation" : {
 						"val" : 0,
 						"type" : "NO_RETALIATION",
-						"duration" : "UNITL_BEING_ATTACKED"
+						"duration" : "UNTIL_BEING_ATTACKED"
 					},
 					"defenceBoost" : {
 						"type" : "PRIMARY_SKILL",
@@ -33,7 +33,7 @@
 						"val" : 50,
 						"valueType" : "PERCENT_TO_ALL",
 						"duration" : [
-						    "UNITL_BEING_ATTACKED",
+						    "UNTIL_BEING_ATTACKED",
 						    "N_TURNS"
 						]
 					}
@@ -176,14 +176,14 @@
 						"type" : "NOT_ACTIVE",
 						"subtype" : 74,
 						"duration" : [
-							"UNITL_BEING_ATTACKED",
+							"UNTIL_BEING_ATTACKED",
 							"N_TURNS"
 						]
 					},
 					"noRetaliation" : {
 						"val" : 0,
 						"type" : "NO_RETALIATION",
-						"duration" : "UNITL_BEING_ATTACKED"
+						"duration" : "UNTIL_BEING_ATTACKED"
 					}
 				}
 			}

+ 3 - 3
config/spells/timed.json

@@ -1288,14 +1288,14 @@
 						"type" : "NOT_ACTIVE",
 						"subtype" : 62,
 						"duration" : [
-							"UNITL_BEING_ATTACKED",
+							"UNTIL_BEING_ATTACKED",
 							"N_TURNS"
 						]
 					},
 					"generalAttackReduction" : {
 						"type" : "GENERAL_ATTACK_REDUCTION",
 						"duration" : [
-							"UNITL_BEING_ATTACKED",
+							"UNTIL_BEING_ATTACKED",
 							"N_TURNS"
 						]
 					}
@@ -1307,7 +1307,7 @@
 						"val" : 0,
 						"type" : "NO_RETALIATION",
 						"duration" : [
-							"UNITL_BEING_ATTACKED",
+							"UNTIL_BEING_ATTACKED",
 							"N_TURNS"
 						]
 					}

+ 2 - 1
lib/HeroBonus.cpp

@@ -47,10 +47,11 @@ const std::map<std::string, ui16> bonusDurationMap =
 	BONUS_ITEM(ONE_WEEK)
 	BONUS_ITEM(N_TURNS)
 	BONUS_ITEM(N_DAYS)
-	BONUS_ITEM(UNITL_BEING_ATTACKED)
+	BONUS_ITEM(UNTIL_BEING_ATTACKED)
 	BONUS_ITEM(UNTIL_ATTACK)
 	BONUS_ITEM(STACK_GETS_TURN)
 	BONUS_ITEM(COMMANDER_KILLED)
+	{ "UNITL_BEING_ATTACKED", Bonus::UNTIL_BEING_ATTACKED }//typo, but used in some mods
 };
 
 const std::map<std::string, Bonus::LimitEffect> bonusLimitEffect =

+ 2 - 2
lib/HeroBonus.h

@@ -267,7 +267,7 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this<Bonus>
 		ONE_WEEK = 8, //at the end of week (bonus lasts till the end of week, thats NOT 7 days
 		N_TURNS = 16, //used during battles, after battle bonus is always removed
 		N_DAYS = 32,
-		UNITL_BEING_ATTACKED = 64, /*removed after attack and counterattacks are performed*/
+		UNTIL_BEING_ATTACKED = 64, /*removed after attack and counterattacks are performed*/
 		UNTIL_ATTACK = 128, /*removed after attack and counterattacks are performed*/
 		STACK_GETS_TURN = 256, /*removed when stack gets its turn - used for defensive stance*/
 		COMMANDER_KILLED = 512
@@ -373,7 +373,7 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this<Bonus>
 	}
 	static bool UntilBeingAttacked(const Bonus *hb)
 	{
-		return hb->duration & Bonus::UNITL_BEING_ATTACKED;
+		return hb->duration & Bonus::UNTIL_BEING_ATTACKED;
 	}
 	static bool UntilCommanderKilled(const Bonus *hb)
 	{