From 71bbf2d44ba5fc00fcb15ed96aff083342309498 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 28 Jan 2013 16:54:11 +0000 Subject: Renamed HOOK_KILLED to HOOK_KILLING to match naming conventions. Also tweaked the mechanics so that plugins may revive without dropping other plugins out of the picture. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1182 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Pawn.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/Pawn.cpp') diff --git a/source/Pawn.cpp b/source/Pawn.cpp index 451dd3af9..d0546eccc 100644 --- a/source/Pawn.cpp +++ b/source/Pawn.cpp @@ -121,13 +121,13 @@ void cPawn::DoTakeDamage(TakeDamageInfo & a_TDI) void cPawn::KilledBy(cPawn * a_Killer) { - short OldHealth = m_Health; m_Health = 0; - if (cRoot::Get()->GetPluginManager()->CallHookKilled(*this, a_Killer)) + cRoot::Get()->GetPluginManager()->CallHookKilling(*this, a_Killer); + + if (m_Health > 0) { - // Plugin wants to 'unkill' the pawn. Set health back and abort - m_Health = OldHealth; + // Plugin wants to 'unkill' the pawn. Abort return; } -- cgit v1.2.3