diff options
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index badf41abde8..504226a2c2a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -219,7 +219,7 @@ void EscortAI::UpdateAI(uint32 diff) } // Check if player or any member of his group is within range - if (_despawnAtFar && HasEscortState(STATE_ESCORT_ESCORTING) && _playerGUID && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING)) + if (_despawnAtFar && HasEscortState(STATE_ESCORT_ESCORTING) && _playerGUID && !me->IsEngaged() && !HasEscortState(STATE_ESCORT_RETURNING)) { if (_playerCheckTimer <= diff) { @@ -231,10 +231,13 @@ void EscortAI::UpdateAI(uint32 diff) if (CreatureData const* creatureData = me->GetCreatureData()) isEscort = (sWorld->getBoolConfig(CONFIG_RESPAWN_DYNAMIC_ESCORTNPC) && (creatureData->spawnGroupData->flags & SPAWNGROUP_FLAG_ESCORTQUESTNPC)); - if (_instantRespawn && !isEscort) - me->DespawnOrUnsummon(0, Seconds(1)); - else if (_instantRespawn && isEscort) - me->GetMap()->RemoveRespawnTime(SPAWN_TYPE_CREATURE, me->GetSpawnId(), true); + if (_instantRespawn) + { + if (!isEscort) + me->DespawnOrUnsummon(0, 1s); + else + me->GetMap()->RemoveRespawnTime(SPAWN_TYPE_CREATURE, me->GetSpawnId(), true); + } else me->DespawnOrUnsummon(); |
