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;
|
float distance = 30.f;
|
||||||
|
|
||||||
Unit* target = AI_VALUE(Unit*, "enemy player target");
|
Unit* target = AI_VALUE(Unit*, "enemy player target");
|
||||||
|
if (target && !target->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!target)
|
if (!target)
|
||||||
target = AI_VALUE(Unit*, "grind target");
|
target = AI_VALUE(Unit*, "grind target");
|
||||||
|
|
||||||
@@ -76,6 +79,10 @@ bool SprintTrigger::IsActive()
|
|||||||
|
|
||||||
Unit* dps = AI_VALUE(Unit*, "dps target");
|
Unit* dps = AI_VALUE(Unit*, "dps target");
|
||||||
Unit* enemyPlayer = AI_VALUE(Unit*, "enemy player target");
|
Unit* enemyPlayer = AI_VALUE(Unit*, "enemy player target");
|
||||||
|
|
||||||
|
if (enemyPlayer && !enemyPlayer->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (dps)
|
if (dps)
|
||||||
targeted = (dps == AI_VALUE(Unit*, "current target"));
|
targeted = (dps == AI_VALUE(Unit*, "current target"));
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class NearestUnitsValue : public ObjectGuidListCalculatedValue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NearestUnitsValue(PlayerbotAI* botAI, std::string const name = "nearest units", float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false) :
|
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;
|
GuidVector Calculate() override;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Unit;
|
|||||||
class SnareTargetValue : public UnitCalculatedValue, public Qualified
|
class SnareTargetValue : public UnitCalculatedValue, public Qualified
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SnareTargetValue(PlayerbotAI* botAI) : UnitCalculatedValue(botAI, "snare target", 1 * 1000) { }
|
SnareTargetValue(PlayerbotAI* botAI) : UnitCalculatedValue(botAI, "snare target", 1) { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Unit* Calculate() override;
|
Unit* Calculate() override;
|
||||||
|
|||||||
Reference in New Issue
Block a user