Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[12158] Fixup problems with recent teleportation changes
- Loading branch information
1 parent
7dedd50
commit 57884bc
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1631,28 +1631,36 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati | |
return false; | ||
} | ||
|
||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid); // Validity checked in IsValidMapCoord | ||
|
||
// preparing unsummon pet if lost (we must get pet before teleportation or will not find it later) | ||
Pet* pet = GetPet(); | ||
|
||
MapEntry const* mEntry = sMapStore.LookupEntry(mapid); | ||
|
||
// don't let enter battlegrounds without assigned battleground id (for example through areatrigger)... | ||
// don't let gm level > 1 either | ||
if (!InBattleGround() && mEntry->IsBattleGroundOrArena()) | ||
return false; | ||
|
||
// Get MapEntrance trigger if teleport to other -nonBG- map | ||
bool assignedAreaTrigger = false; | ||
if (GetMapId() != mapid && !mEntry->IsBattleGroundOrArena() && !at) | ||
{ | ||
at = sObjectMgr.GetMapEntranceTrigger(mapid); | ||
assignedAreaTrigger = true; | ||
} | ||
|
||
// Check requirements for teleport | ||
if (GetMapId() != mapid || m_transport || at) // NOT(sameCheckAsBelow) OR at | ||
if (at) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cyberium
Member
|
||
{ | ||
uint32 miscRequirement = 0; | ||
AreaLockStatus lockStatus = GetAreaTriggerLockStatus(at ? at : sObjectMgr.GetMapEntranceTrigger(mapid), GetDifficulty(mEntry->IsRaid()), miscRequirement); | ||
AreaLockStatus lockStatus = GetAreaTriggerLockStatus(at, GetDifficulty(mEntry->IsRaid()), miscRequirement); | ||
if (lockStatus != AREA_LOCKSTATUS_OK) | ||
{ | ||
// Teleport not requested by area-trigger | ||
// TODO - Assume a player with expansion 0 travels from BootyBay to Ratched, and he is attempted to be teleported to outlands | ||
// then he will repop near BootyBay instead of normally continuing his journey | ||
// This code is probably added to catch passengers on ships to northrend who shouldn't go there | ||
if (lockStatus == AREA_LOCKSTATUS_INSUFFICIENT_EXPANSION && !at && GetTransport()) | ||
if (lockStatus == AREA_LOCKSTATUS_INSUFFICIENT_EXPANSION && !assignedAreaTrigger && GetTransport()) | ||
RepopAtGraveyard(); // Teleport to near graveyard if on transport, looks blizz like :) | ||
|
||
SendTransferAbortedByLockStatus(mEntry, lockStatus, miscRequirement); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ifndef __REVISION_NR_H__ | ||
#define __REVISION_NR_H__ | ||
#define REVISION_NR "12157" | ||
#define REVISION_NR "12158" | ||
#endif // __REVISION_NR_H__ |
Is this will work in transport case?