Skip to content

Commit

Permalink
Spell: Tryfix exploit for when dead player is being revived in differ…
Browse files Browse the repository at this point in the history
…ent instance id
  • Loading branch information
killerwife committed Dec 4, 2023
1 parent 6c9da3d commit 6e6ba03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/game/Entities/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,7 @@ class Player : public Unit
bool IsBeingTeleported() const { return m_semaphoreTeleport_Near || m_semaphoreTeleport_Far; }
bool IsBeingTeleportedNear() const { return m_semaphoreTeleport_Near; }
bool IsBeingTeleportedFar() const { return m_semaphoreTeleport_Far; }
bool IsDelayedResurrect() const { return m_DelayedOperations & DELAYED_RESURRECT_PLAYER; }
void SetSemaphoreTeleportNear(bool semphsetting);
void SetSemaphoreTeleportFar(bool semphsetting);
void ProcessDelayedOperations();
Expand Down
12 changes: 11 additions & 1 deletion src/game/MotionGenerators/MovementHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}

uint32 miscRequirement = 0;
if (AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(loc.mapid))
AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(loc.mapid);
if (at)
{
if (AREA_LOCKSTATUS_OK != GetPlayer()->GetAreaTriggerLockStatus(at, miscRequirement))
{
Expand All @@ -140,6 +141,15 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (!map)
map = sMapMgr.CreateMap(loc.mapid, GetPlayer());

// if dead player is entering an instance of same id but corpse is not found, likely means entering different instance id
if (GetPlayer()->IsDelayedResurrect() && !map->GetCorpse(GetPlayer()->GetObjectGuid()) && at)
{
// respawn at entrance
loc.coord_x = at->target_X;
loc.coord_y = at->target_Y;
loc.coord_z = at->target_Z;
}

GetPlayer()->SetMap(map);
bool found = true;
if (GetPlayer()->m_teleportTransport)
Expand Down

0 comments on commit 6e6ba03

Please sign in to comment.