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.)
This commit is contained in:
Treeston
2018-09-12 15:28:03 +02:00
parent f50a8e5926
commit 7bc16e2ee6
2 changed files with 16 additions and 12 deletions

View File

@@ -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());