mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Crash fix trial: move to rpg target
This commit is contained in:
@@ -13,7 +13,13 @@ bool MoveToRpgTargetAction::Execute(Event event)
|
|||||||
{
|
{
|
||||||
GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target");
|
GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target");
|
||||||
Unit* unit = botAI->GetUnit(guidP);
|
Unit* unit = botAI->GetUnit(guidP);
|
||||||
|
if (unit && !unit->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
GameObject* go = botAI->GetGameObject(guidP);
|
GameObject* go = botAI->GetGameObject(guidP);
|
||||||
|
if (go && !go->IsInWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Player* player = guidP.GetPlayer();
|
Player* player = guidP.GetPlayer();
|
||||||
|
|
||||||
WorldObject* wo = nullptr;
|
WorldObject* wo = nullptr;
|
||||||
@@ -90,7 +96,7 @@ bool MoveToRpgTargetAction::Execute(Event event)
|
|||||||
if (bot->IsWithinLOS(x, y, z))
|
if (bot->IsWithinLOS(x, y, z))
|
||||||
couldMove = MoveNear(mapId, x, y, z, 0);
|
couldMove = MoveNear(mapId, x, y, z, 0);
|
||||||
else
|
else
|
||||||
couldMove = MoveTo(mapId, x, y, z, false, false);
|
couldMove = MoveTo(mapId, x, y, z, false, false, true);
|
||||||
|
|
||||||
if (!couldMove && WorldPosition(mapId, x, y, z).distance(bot) > INTERACTION_DISTANCE)
|
if (!couldMove && WorldPosition(mapId, x, y, z).distance(bot) > INTERACTION_DISTANCE)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user