mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Remove hardcoded checks for town portal from AI code
This commit is contained in:
@@ -19,5 +19,5 @@ Goals::TSubgoal TownPortalAction::whatToDo(const HeroPtr & hero) const
|
||||
{
|
||||
const CGTownInstance * targetTown = target; // const pointer is not allowed in settown
|
||||
|
||||
return Goals::sptr(Goals::AdventureSpellCast(hero, SpellID::TOWN_PORTAL).settown(targetTown).settile(targetTown->visitablePos()));
|
||||
return Goals::sptr(Goals::AdventureSpellCast(hero, spellToUse).settown(targetTown).settile(targetTown->visitablePos()));
|
||||
}
|
||||
|
||||
@@ -20,10 +20,12 @@ namespace AIPathfinding
|
||||
{
|
||||
private:
|
||||
const CGTownInstance * target;
|
||||
SpellID spellToUse;
|
||||
|
||||
public:
|
||||
TownPortalAction(const CGTownInstance * target)
|
||||
TownPortalAction(const CGTownInstance * target, SpellID spellToUse)
|
||||
:target(target)
|
||||
,spellToUse(spellToUse)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user