Scripts/Commands: Fix a crash on summon when no group is avaible (#20029)
Closes #20027
This commit is contained in:
1 parent
61b0fbb9c9
commit
b583c1ffec
1 file changed
+3
-2
@@ -542,9 +542,10 @@ public:
|
||||
}
|
||||
else if (map->Instanceable())
|
||||
{
|
||||
Group* targetGroup = target->GetGroup();
|
||||
Map* targetMap = target->GetMap();
|
||||
Player* targetGroupLeader = ObjectAccessor::GetPlayer(map, targetGroup->GetLeaderGUID());
|
||||
Player* targetGroupLeader = nullptr;
|
||||
if (Group* targetGroup = target->GetGroup())
|
||||
targetGroupLeader = ObjectAccessor::GetPlayer(map, targetGroup->GetLeaderGUID());
|
||||
|
||||
// check if far teleport is allowed
|
||||
if (!targetGroupLeader || (targetGroupLeader->GetMapId() != map->GetId()) || (targetGroupLeader->GetInstanceId() != map->GetInstanceId()))
|
||||
|
||||
Reference in new issue
Block a user