Explorar o código

More comments about dispell special cases.

AlexVinS %!s(int64=10) %!d(string=hai) anos
pai
achega
eeb100d6a4
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 2 0
      lib/NetPacksLib.cpp
  2. 1 1
      lib/spells/CDefaultSpellMechanics.cpp

+ 2 - 0
lib/NetPacksLib.cpp

@@ -1465,6 +1465,8 @@ DLL_LINKAGE void StacksHealedOrResurrected::applyGs( CGameState *gs )
 			auto selector = [](const Bonus * b)
 			{
 				const CSpell *s = b->sourceSpell();
+				//Special case: DISRUPTING_RAY is "immune" to dispell
+				//Other even PERMANENT effects can be removed
 				return (s != nullptr) && s->isNegative() && (s->id != SpellID::DISRUPTING_RAY);
 			};
 			changedStack->popBonuses(selector);

+ 1 - 1
lib/spells/CDefaultSpellMechanics.cpp

@@ -139,7 +139,7 @@ void DefaultSpellMechanics::applyBattle(BattleInfo * battle, const BattleSpellCa
 			//check for each bonus if it should be removed
 			const bool isSpellEffect = Selector::sourceType(Bonus::SPELL_EFFECT)(b);
 			const int spellID = isSpellEffect ? b->sid : -1;
-
+			//No exceptions, ANY spell can be countered, even if it can`t be dispelled.
 			return isSpellEffect && vstd::contains(owner->counteredSpells, spellID);
 		});
 	}