crash fix 4

This commit is contained in:
Yunfan Li
2023-12-17 17:16:38 +08:00
parent 5e6ddce6b2
commit 897ee35b4e
2 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,10 @@ bool AttackAction::Execute(Event event)
Unit* target = GetTarget();
if (!target)
return false;
if (!target->IsInWorld()) {
return false;
}
return Attack(target);
}

View File

@@ -24,7 +24,7 @@ class NearestEnemyPlayersValue : public PossibleTargetsValue
class EnemyPlayerValue : public UnitCalculatedValue
{
public:
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 5 * 1000) { }
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 1 * 1000) { }
Unit* Calculate() override;