mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
crash fix 4
This commit is contained in:
@@ -15,7 +15,10 @@ bool AttackAction::Execute(Event event)
|
||||
Unit* target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
|
||||
if (!target->IsInWorld()) {
|
||||
return false;
|
||||
}
|
||||
return Attack(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user