1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

vcmi: add getTrigger method to obstacles

Fixes advanced remove obstacle spell
This commit is contained in:
Konstantin
2023-03-31 00:49:51 +03:00
parent 82a6d94fd0
commit d8a237ba46
8 changed files with 25 additions and 33 deletions

View File

@ -5263,7 +5263,7 @@ bool CGameHandler::handleDamageFromObstacle(const CStack * curStack, bool stackI
auto shouldReveal = !spellObstacle->hidden || !gs->curB->battleIsObstacleVisibleForSide(*obstacle, (BattlePerspective::BattlePerspective)side);
const auto * hero = gs->curB->battleGetFightingHero(spellObstacle->casterSide);
auto caster = spells::ObstacleCasterProxy(gs->curB->getSidePlayer(spellObstacle->casterSide), hero, *spellObstacle);
const auto * sp = SpellID(spellObstacle->ID).toSpell();
const auto * sp = obstacle->getTrigger().toSpell();
if(obstacle->triggersEffects() && sp)
{
auto cast = spells::BattleCast(gs->curB, &caster, spells::Mode::PASSIVE, sp);