Core/Misc: Fix various crashes, also related to multithreading
Port From (https://github.com/TrinityCore/TrinityCore/commit/ad008c43b75080ec59aa973f1e2e4424332c34a4)
This commit is contained in:
@@ -249,6 +249,8 @@ namespace Game.AI
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next())
|
||||
{
|
||||
Player groupGuy = groupRef.GetSource();
|
||||
if (!groupGuy.IsInMap(player))
|
||||
continue;
|
||||
|
||||
if (!fail && groupGuy.IsAtGroupRewardDistance(me) && !groupGuy.GetCorpse())
|
||||
groupGuy.AreaExploredOrEventHappens(mEscortQuestID);
|
||||
@@ -402,8 +404,7 @@ namespace Game.AI
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next())
|
||||
{
|
||||
Player groupGuy = groupRef.GetSource();
|
||||
|
||||
if (me.GetDistance(groupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST)
|
||||
if (groupGuy.IsInMap(player) && me.GetDistance(groupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user