aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CharacterHandler.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-09-12 15:28:03 +0200
committerTreeston <treeston.mmoc@gmail.com>2018-09-12 15:28:03 +0200
commit7bc16e2ee6ace39588a991537ff28811000a16c2 (patch)
treee85cf4acfa6c6e2f49a4e57de634c8e5311e034b /src/server/game/Handlers/CharacterHandler.cpp
parentf50a8e5926372400e87337fdcdcd03fd68a8a4c6 (diff)
Core/Unit: Erm, so it turns out that releasing your spirit actually never set your death state to DEAD. It stayed as CORPSE. That's wrong, of course, but we didn't notice because zombie corpses (see f50a8e5).
Zombie corpses are gone, so now it caused a bug. That's fixed too. Closes #21873. (Finally.)
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 1756fa8e967..a762a0a6aae 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -857,15 +857,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
pCurrChar->LoadCorpse(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION));
// setting Ghost+speed if dead
- if (pCurrChar->m_deathState != ALIVE)
- {
- // not blizz like, we must correctly save and load player instead...
- if (pCurrChar->getRace() == RACE_NIGHTELF)
- pCurrChar->CastSpell(pCurrChar, 20584, true);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
- pCurrChar->CastSpell(pCurrChar, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
-
+ if (pCurrChar->m_deathState == DEAD)
pCurrChar->SetMovement(MOVE_WATER_WALK);
- }
pCurrChar->ContinueTaxiFlight();
@@ -998,6 +991,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// Handle Login-Achievements (should be handled after loading)
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN, 1);
+ // if we're loading a dead player, repop them to the GY after the load is finished
+ if (pCurrChar->getDeathState() == CORPSE)
+ {
+ pCurrChar->BuildPlayerRepop();
+ pCurrChar->RepopAtGraveyard();
+ }
+
sScriptMgr->OnPlayerLogin(pCurrChar, firstLogin);
TC_METRIC_EVENT("player_events", "Login", pCurrChar->GetName());