1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

ENCHANTER_CASTING trigger tweak

This commit is contained in:
AlexVinS
2017-06-05 21:41:27 +03:00
parent 66cfc2fef9
commit 1d1519db5c
3 changed files with 14 additions and 11 deletions

View File

@@ -87,10 +87,14 @@ void BattleSpellCastParameters::cast(const SpellCastEnvironment * env)
spell->battleCast(env, *this);
}
void BattleSpellCastParameters::castIfPossible(const SpellCastEnvironment * env)
bool BattleSpellCastParameters::castIfPossible(const SpellCastEnvironment * env)
{
if(ESpellCastProblem::OK == cb->battleCanCastThisSpell(caster, spell, mode))
{
cast(env);
return true;
}
return false;
}
BattleHex BattleSpellCastParameters::getFirstDestinationHex() const

View File

@@ -57,7 +57,8 @@ public:
void cast(const SpellCastEnvironment * env);
///cast with silent check for permitted cast
void castIfPossible(const SpellCastEnvironment * env);
///returns true if cast was permitted
bool castIfPossible(const SpellCastEnvironment * env);
BattleHex getFirstDestinationHex() const;