mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
crash fix
This commit is contained in:
@@ -29,6 +29,9 @@ bool StealthTrigger::IsActive()
|
||||
float distance = 30.f;
|
||||
|
||||
Unit* target = AI_VALUE(Unit*, "enemy player target");
|
||||
if (target && !target->IsInWorld()) {
|
||||
return false;
|
||||
}
|
||||
if (!target)
|
||||
target = AI_VALUE(Unit*, "grind target");
|
||||
|
||||
@@ -76,6 +79,10 @@ bool SprintTrigger::IsActive()
|
||||
|
||||
Unit* dps = AI_VALUE(Unit*, "dps target");
|
||||
Unit* enemyPlayer = AI_VALUE(Unit*, "enemy player target");
|
||||
|
||||
if (enemyPlayer && !enemyPlayer->IsInWorld()) {
|
||||
return false;
|
||||
}
|
||||
if (dps)
|
||||
targeted = (dps == AI_VALUE(Unit*, "current target"));
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class NearestUnitsValue : public ObjectGuidListCalculatedValue
|
||||
{
|
||||
public:
|
||||
NearestUnitsValue(PlayerbotAI* botAI, std::string const name = "nearest units", float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false) :
|
||||
ObjectGuidListCalculatedValue(botAI, name, 1 * 1000), range(range), ignoreLos(ignoreLos) { }
|
||||
ObjectGuidListCalculatedValue(botAI, name, 1), range(range), ignoreLos(ignoreLos) { }
|
||||
|
||||
GuidVector Calculate() override;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class Unit;
|
||||
class SnareTargetValue : public UnitCalculatedValue, public Qualified
|
||||
{
|
||||
public:
|
||||
SnareTargetValue(PlayerbotAI* botAI) : UnitCalculatedValue(botAI, "snare target", 1 * 1000) { }
|
||||
SnareTargetValue(PlayerbotAI* botAI) : UnitCalculatedValue(botAI, "snare target", 1) { }
|
||||
|
||||
protected:
|
||||
Unit* Calculate() override;
|
||||
|
||||
Reference in New Issue
Block a user