aboutsummaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-02 10:44:20 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-12-02 10:44:20 +0200
commit5344dec760649e356d93a47a56a0c49871ad81de (patch)
tree4df18d91912833d3b3fb406e43c75cf8e897aecc /src/environment.cpp
parent89bc3066328cf7500a8ef978d5e5ed6c1c154576 (diff)
downloadminetest-5344dec760649e356d93a47a56a0c49871ad81de.tar.gz
minetest-5344dec760649e356d93a47a56a0c49871ad81de.tar.bz2
minetest-5344dec760649e356d93a47a56a0c49871ad81de.zip
Move ServerRemotePlayer to a separate file
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index e8dfebcb3..ce81a1941 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodemetadata.h"
#include "main.h" // For g_settings, g_profiler
#include "gamedef.h"
+#include "serverremoteplayer.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
@@ -2189,15 +2190,17 @@ void ClientEnvironment::processActiveObjectMessage(u16 id,
Callbacks for activeobjects
*/
-void ClientEnvironment::damageLocalPlayer(u8 damage)
+void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
{
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
-
- if(lplayer->hp > damage)
- lplayer->hp -= damage;
- else
- lplayer->hp = 0;
+
+ if(handle_hp){
+ if(lplayer->hp > damage)
+ lplayer->hp -= damage;
+ else
+ lplayer->hp = 0;
+ }
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;