mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user