1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Support for custom cursors for adventure map spells

This commit is contained in:
Ivan Savenko
2025-07-11 15:33:48 +03:00
parent a53aadf53a
commit 55bd4bc8bf
21 changed files with 300 additions and 230 deletions

View File

@@ -1234,11 +1234,10 @@ void CPlayerInterface::heroBonusChanged( const CGHeroInstance *hero, const Bonus
return;
adventureInt->onHeroChanged(hero);
if ((bonus.type == BonusType::FLYING_MOVEMENT || bonus.type == BonusType::WATER_WALKING) && !gain)
{
//recalculate paths because hero has lost bonus influencing pathfinding
localState->erasePath(hero);
}
//recalculate paths because hero has lost or gained bonus influencing pathfinding
if ((bonus.type == BonusType::FLYING_MOVEMENT || bonus.type == BonusType::WATER_WALKING || bonus.type == BonusType::ROUGH_TERRAIN_DISCOUNT || bonus.type == BonusType::NO_TERRAIN_PENALTY))
localState->verifyPath(hero);
}
void CPlayerInterface::moveHero( const CGHeroInstance *h, const CGPath& path )
@@ -1602,9 +1601,6 @@ void CPlayerInterface::advmapSpellCast(const CGHeroInstance * caster, SpellID sp
if(ENGINE->windows().topWindow<CSpellWindow>())
ENGINE->windows().popWindows(1);
if(spellID == SpellID::FLY || spellID == SpellID::WATER_WALK)
localState->erasePath(caster);
auto castSoundPath = spellID.toSpell()->getCastSound();
if(!castSoundPath.empty())
ENGINE->sound().playSound(castSoundPath);