mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Fixed Enchanter ability.
This commit is contained in:
@ -4496,7 +4496,7 @@ void CGameHandler::stackTurnTrigger(const CStack * st)
|
|||||||
if (st->alive())
|
if (st->alive())
|
||||||
{
|
{
|
||||||
//unbind
|
//unbind
|
||||||
if (st->getEffect(72))
|
if (st->getEffect (SpellID::BIND))
|
||||||
{
|
{
|
||||||
bool unbind = true;
|
bool unbind = true;
|
||||||
BonusList bl = *(st->getBonuses(Selector::type(Bonus::BIND_EFFECT)));
|
BonusList bl = *(st->getBonuses(Selector::type(Bonus::BIND_EFFECT)));
|
||||||
@ -4590,7 +4590,7 @@ void CGameHandler::stackTurnTrigger(const CStack * st)
|
|||||||
{
|
{
|
||||||
int index = rand() % bl.size();
|
int index = rand() % bl.size();
|
||||||
SpellID spellID = SpellID(bl[index]->subtype);
|
SpellID spellID = SpellID(bl[index]->subtype);
|
||||||
if (gs->curB->battleCanCastThisSpell(st->owner, SpellID(spellID).toSpell(), ECastingMode::ENCHANTER_CASTING)) //TODO: select another?
|
if (gs->curB->battleCanCastThisSpell(st->owner, SpellID(spellID).toSpell(), ECastingMode::ENCHANTER_CASTING) == ESpellCastProblem::OK) //TODO: select another available?
|
||||||
{
|
{
|
||||||
int spellLeveL = bl[index]->val; //spell level
|
int spellLeveL = bl[index]->val; //spell level
|
||||||
const CGHeroInstance * enemyHero = gs->curB->getHero(gs->curB->theOtherPlayer(st->owner));
|
const CGHeroInstance * enemyHero = gs->curB->getHero(gs->curB->theOtherPlayer(st->owner));
|
||||||
|
Reference in New Issue
Block a user