Skip to content

Commit 31f9e17

Browse files
imstuckbrokaytotesShauren
authored
Core/GameObject: Mage Portals and Refreshment Tables should be usable when the creating Mage is on another map or offline as long as you remain in group (#31730)
Closes #31527 Co-authored-by: CraftedRO <268975402+imstuckbro@users.noreply.github.com> Co-authored-by: Kaytotes <kaytotes@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com>
1 parent ef26e36 commit 31f9e17

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/server/game/Entities/GameObject/GameObject.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,12 +2034,23 @@ void GameObject::Use(Unit* user)
20342034

20352035
if (info->spellcaster.partyOnly)
20362036
{
2037-
Unit* caster = GetOwner();
2038-
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
2037+
ObjectGuid ownerGuid = GetOwnerGUID();
2038+
if (ownerGuid.IsEmpty())
20392039
return;
20402040

2041-
if (user->GetTypeId() != TYPEID_PLAYER || !user->ToPlayer()->IsInSameRaidWith(caster->ToPlayer()))
2042-
return;
2041+
if (ownerGuid != user->GetGUID())
2042+
{
2043+
if (Unit* owner = ObjectAccessor::GetUnit(*this, ownerGuid))
2044+
ownerGuid = owner->GetCharmerOrOwnerOrOwnGUID();
2045+
2046+
Player const* playerUser = user->GetCharmerOrOwnerPlayerOrPlayerItself();
2047+
if (!playerUser)
2048+
return;
2049+
2050+
Group const* group = playerUser->GetGroup();
2051+
if (!group || !group->IsMember(ownerGuid))
2052+
return;
2053+
}
20432054
}
20442055

20452056
user->RemoveAurasByType(SPELL_AURA_MOUNTED);

0 commit comments

Comments
 (0)