From 245d17a9e920da63d55ce7aa16897f10b6554aae Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Fri, 30 Sep 2016 01:57:33 +0300 Subject: [PATCH] Fixed typo bonus duration enum. Mod compatibility retained. --- config/spells/ability.json | 10 +++++----- config/spells/timed.json | 6 +++--- lib/HeroBonus.cpp | 3 ++- lib/HeroBonus.h | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/config/spells/ability.json b/config/spells/ability.json index 92f4125ae..bcec994d8 100644 --- a/config/spells/ability.json +++ b/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" } } } diff --git a/config/spells/timed.json b/config/spells/timed.json index 264e8943a..5d07874ec 100644 --- a/config/spells/timed.json +++ b/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" ] } diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index 3991a45b6..1c055a4d1 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -47,10 +47,11 @@ const std::map 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 bonusLimitEffect = diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 5cb48ef17..fe488472c 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -267,7 +267,7 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this 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 } 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) {