Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Core/Creature): SelectLevel hooks return IsDead() = True during respawn #17712

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/server/game/Entities/Creature/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,11 +2041,12 @@ void Creature::Respawn(bool force)
}

LOG_DEBUG("entities.unit", "Respawning creature {} (SpawnId: {}, {})", GetName(), GetSpawnId(), GetGUID().ToString());
setDeathState(DeathState::Respawning);
m_respawnTime = 0;
ResetPickPocketLootTime();
loot.clear();
SelectLevel();

SelectLevel();
setDeathState(DeathState::JustRespawned);
Comment on lines +2044 to 2050
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this would just be a hackfix to be fair


// MDic - Acidmanifesto
Expand Down
3 changes: 2 additions & 1 deletion src/server/game/Entities/Unit/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ enum class DeathState : uint8
JustDied = 1,
Corpse = 2,
Dead = 3,
JustRespawned = 4,
Respawning = 4,
JustRespawned = 5,
};

enum UnitState
Expand Down