mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-31 06:07:37 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user