mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Removed hardcoded checks for Summon Boat spell
This commit is contained in:
@@ -23,7 +23,7 @@ namespace AIPathfinding
|
||||
|
||||
Goals::TSubgoal SummonBoatAction::whatToDo(const HeroPtr & hero) const
|
||||
{
|
||||
return Goals::sptr(Goals::AdventureSpellCast(hero, SpellID::SUMMON_BOAT));
|
||||
return Goals::sptr(Goals::AdventureSpellCast(hero, usedSpell));
|
||||
}
|
||||
|
||||
void SummonBoatAction::applyOnDestination(
|
||||
@@ -53,8 +53,6 @@ namespace AIPathfinding
|
||||
|
||||
uint32_t SummonBoatAction::getManaCost(const CGHeroInstance * hero) const
|
||||
{
|
||||
SpellID summonBoat = SpellID::SUMMON_BOAT;
|
||||
|
||||
return hero->getSpellCost(summonBoat.toSpell());
|
||||
return hero->getSpellCost(usedSpell.toSpell());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,11 @@ namespace AIPathfinding
|
||||
|
||||
class SummonBoatAction : public VirtualBoatAction
|
||||
{
|
||||
SpellID usedSpell;
|
||||
public:
|
||||
SummonBoatAction()
|
||||
SummonBoatAction(SpellID usedSpell)
|
||||
:VirtualBoatAction(AINodeStorage::CAST_CHAIN)
|
||||
,usedSpell(usedSpell)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user