diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-28 17:54:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-28 17:54:11 +0100 |
commit | 71bbf2d44ba5fc00fcb15ed96aff083342309498 (patch) | |
tree | 94657c14eddc2f81fe55d8c6a15e22165f6d7897 /source/Pawn.cpp | |
parent | Updated HookNotify with the hook renaming. (diff) | |
download | cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.gz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.bz2 cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.lz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.xz cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.tar.zst cuberite-71bbf2d44ba5fc00fcb15ed96aff083342309498.zip |
Diffstat (limited to 'source/Pawn.cpp')
-rw-r--r-- | source/Pawn.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |