From 1a1774a1051790ef85b1bd8b047ac45a3676b5d6 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 10 Jul 2015 15:58:32 -0400 Subject: Fix damage flash when damage disabled --- src/script/lua_api/l_object.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/script/lua_api/l_object.cpp') diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 4b1cc39fb..e407ef162 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -222,15 +222,13 @@ int ObjectRef::l_punch(lua_State *L) // If the punched is a player, and its HP changed if (src_original_hp != co->getHP() && co->getType() == ACTIVEOBJECT_TYPE_PLAYER) { - getServer(L)->SendPlayerHPOrDie(((PlayerSAO*)co)->getPeerID(), - co->getHP() == 0); + getServer(L)->SendPlayerHPOrDie((PlayerSAO *)co); } // If the puncher is a player, and its HP changed if (dst_origin_hp != puncher->getHP() && puncher->getType() == ACTIVEOBJECT_TYPE_PLAYER) { - getServer(L)->SendPlayerHPOrDie(((PlayerSAO*)puncher)->getPeerID(), - puncher->getHP() == 0); + getServer(L)->SendPlayerHPOrDie((PlayerSAO *)puncher); } return 0; } @@ -265,9 +263,9 @@ int ObjectRef::l_set_hp(lua_State *L) <<" hp="<setHP(hp); - if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER) { - getServer(L)->SendPlayerHPOrDie(((PlayerSAO*)co)->getPeerID(), co->getHP() == 0); - } + if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER) + getServer(L)->SendPlayerHPOrDie((PlayerSAO *)co); + // Return return 0; } -- cgit v1.2.3