fix(Core/GameObject): Allow use of Mage portal if caster is offline and still in group (#19797)

search group of user for ownerGUID
This commit is contained in:
Jelle Meeus
2024-09-02 01:56:05 +02:00
committed by GitHub
parent dd32c74a7e
commit 5d4c85143c

View File

@@ -1885,13 +1885,21 @@ void GameObject::Use(Unit* user)
if (info->spellcaster.partyOnly)
{
Player const* caster = ObjectAccessor::FindConnectedPlayer(GetOwnerGUID());
if (!caster || user->GetTypeId() != TYPEID_PLAYER || !user->ToPlayer()->IsInSameRaidWith(caster))
if (!user->IsPlayer())
return;
}
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
spellId = info->spellcaster.spellId;
if (Group* group = user->ToPlayer()->GetGroup())
{
if (ObjectGuid ownerGuid = GetOwnerGUID())
{
if (group->IsMember(ownerGuid))
{
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
spellId = info->spellcaster.spellId;
}
}
}
}
break;
}