projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34c5a5b
)
Fix various damage related bugs (client-side)
author
Craig Robbins
<kde.psych@gmail.com>
Tue, 17 Mar 2015 06:21:48 +0000
(16:21 +1000)
committer
Craig Robbins
<kde.psych@gmail.com>
Tue, 17 Mar 2015 07:08:00 +0000
(17:08 +1000)
E.g. spawning or teleporting into lava to become invinsible
src/environment.cpp
patch
|
blob
|
history
diff --git
a/src/environment.cpp
b/src/environment.cpp
index 953fa2860d6ace5ad4757be50dd28a2fd09aafb6..f83414a6a2a4ebd91c1baecbe60b2d243f7cad78 100644
(file)
--- a/
src/environment.cpp
+++ b/
src/environment.cpp
@@
-2563,16
+2563,10
@@
void ClientEnvironment::damageLocalPlayer(u8 damage, bool handle_hp)
LocalPlayer *lplayer = getLocalPlayer();
assert(lplayer);
- if(handle_hp) {
- // Don't damage a dead player
- if (lplayer->isDead())
- return;
-
- if(lplayer->hp > damage)
- lplayer->hp -= damage;
- else
- lplayer->hp = 0;
- }
+ if (handle_hp && lplayer->hp > damage)
+ lplayer->hp -= damage;
+ else
+ lplayer->hp = 0;
ClientEnvEvent event;
event.type = CEE_PLAYER_DAMAGE;