mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
NKAI: allow multiple tasks to be executed from one calculation
This commit is contained in:
@@ -18,12 +18,12 @@ using namespace Goals;
|
||||
|
||||
bool AdventureSpellCast::operator==(const AdventureSpellCast & other) const
|
||||
{
|
||||
return hero.h == other.hero.h;
|
||||
return hero == other.hero;
|
||||
}
|
||||
|
||||
void AdventureSpellCast::accept(AIGateway * ai)
|
||||
{
|
||||
if(!hero.validAndSet())
|
||||
if(!hero)
|
||||
throw cannotFulfillGoalException("Invalid hero!");
|
||||
|
||||
auto spell = getSpell();
|
||||
@@ -56,7 +56,7 @@ void AdventureSpellCast::accept(AIGateway * ai)
|
||||
auto wait = cb->waitTillRealize;
|
||||
|
||||
cb->waitTillRealize = true;
|
||||
cb->castSpell(hero.h, spellID, tile);
|
||||
cb->castSpell(hero, spellID, tile);
|
||||
|
||||
if(town && spellID == SpellID::TOWN_PORTAL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user