aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/MovementHandler.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2015-12-31 19:51:07 +0100
committerShauren <shauren.trinity@gmail.com>2016-03-21 19:41:28 +0100
commit7422557d03b3cbb5b00a39b16c52f879c2f31fdd (patch)
treec379a50a7ba112b8a4f5149f6c89973939a8675d /src/server/game/Handlers/MovementHandler.cpp
parent96ca739a0b0d2b34a28fbac0593e076fb3c42f1b (diff)
Merge pull request #16110 from Treeston/3.3.5-instancerevive
Game/Maps: Clean up instance zone-in handling (cherry picked from commit eb3dc8a4f064d89b78248a511bcf67f805ea3314)
Diffstat (limited to 'src/server/game/Handlers/MovementHandler.cpp')
-rw-r--r--src/server/game/Handlers/MovementHandler.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index 3ab9f683dea..697060078bc 100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -77,9 +77,9 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
// relocate the player to the teleport destination
- // the CanEnter checks are done in TeleporTo but conditions may change
+ // the CannotEnter checks are done in TeleporTo but conditions may change
// while the player is in transit, for example the map may get full
- if (!newMap || !newMap->CanEnter(GetPlayer()))
+ if (!newMap || newMap->CannotEnter(GetPlayer()))
{
TC_LOG_ERROR("network", "Map %d (%s) could not be created for %s (%s), porting player to homebind", loc.GetMapId(), newMap ? newMap->GetMapName() : "Unknown", GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str());
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
@@ -157,19 +157,18 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
// resurrect character at enter into instance where his corpse exist after add to map
- Corpse* corpse = GetPlayer()->GetMap()->GetCorpseByPlayer(GetPlayer()->GetGUID());
- if (corpse && corpse->GetType() != CORPSE_BONES)
- {
- if (mEntry->IsDungeon())
+
+ if (mEntry->IsDungeon() && !GetPlayer()->IsAlive())
+ if (GetPlayer()->GetCorpseLocation().GetMapId() == mEntry->ID)
{
GetPlayer()->ResurrectPlayer(0.5f, false);
GetPlayer()->SpawnCorpseBones();
}
- }
bool allowMount = !mEntry->IsDungeon() || mEntry->IsBattlegroundOrArena();
if (mInstance)
{
+ // check if this instance has a reset time and send it to player if so
Difficulty diff = GetPlayer()->GetDifficultyID(mEntry);
if (MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mEntry->ID, diff))
{
@@ -182,6 +181,12 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
}
}
+
+ // check if instance is valid
+ if (!GetPlayer()->CheckInstanceValidity(false))
+ GetPlayer()->m_InstanceValid = false;
+
+ // instance mounting is handled in InstanceTemplate
allowMount = mInstance->AllowMount;
}