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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user