From 20947a4c730a68232d901d87cdb06035b6f2573d Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 17:57:20 -0600 Subject: *Do not allow to kill a dead player. (may generate two corpses and cause crash) --HG-- branch : trunk --- src/game/Player.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/Player.cpp') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e5c046034f4..5b5c859097f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1330,8 +1330,14 @@ void Player::setDeathState(DeathState s) bool cur = isAlive(); - if(s == JUST_DIED && cur) + if(s == JUST_DIED) { + if(!cur) + { + sLog.outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow()); + return; + } + // drunken state is cleared on death SetDrunkValue(0); // lost combo points at any target (targeted combo points clear in Unit::setDeathState) -- cgit v1.2.3