mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Commands: Fix a crash on summon when no group is avaible (#20029)
Closes #20027
(cherry picked from commit d9c83a6c01)
This commit is contained in:
@@ -557,9 +557,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