noFallDamage: fix wrong clientside hp #15
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: minetest-stuffs/dragonfire-client-dragonfire#15
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This fixes damage on fall being reported clientside
Write a csm in df that does localplayer:get_hp() and see the hp stay at 0 when falling from something high.
This completely prevents the effects from fall damage.
@ -491,2 +479,3 @@
if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
//if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
if (envEvent.player_damage.send_to_server)
Please remove the comment.
@ -282,3 +289,3 @@
u16 damage = (u16)MYMIN(damage_f + 0.5, U16_MAX);
if (damage != 0) {
if (!g_settings->getBool("prevent_natural_damage") != 0) {
damageLocalPlayer(damage, true);
what is the != 0 for?
@ -491,2 +479,3 @@
if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
//if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
if (envEvent.player_damage.send_to_server)
Also, if (envEvent.player_damage.send_to_server) should stay as it's from minetest code and not a dragonfire addition.
@ -282,3 +289,3 @@
u16 damage = (u16)MYMIN(damage_f + 0.5, U16_MAX);
if (damage != 0) {
if (!g_settings->getBool("prevent_natural_damage") != 0) {
damageLocalPlayer(damage, true);
the check for damage != 0 should stay, its a minetest functionality.
@ -491,2 +479,3 @@
if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
//if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
if (envEvent.player_damage.send_to_server)
mmh yeah i'll test those changes in a bit. I just more or less copied my original noFallDamage hack which was admittedly done with just about 0 knowledge of the codebase. We didn't find any regressions doing it this way tho. But yeah i'll have a look
EDIT:
Def better than having an inconsistent client state though ^^
@ -491,2 +479,3 @@
if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
//if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
if (envEvent.player_damage.send_to_server)
Well what can I say you're 100% right on both accounts .. this one should have the comment removed as you a said and the other one should say settings && damage !=0 sadly i cant seem to be able to commit anything to this rn .. github has somehow changed what repo i forked this from ... man this stuff is annoying lol
@ -282,3 +289,3 @@
u16 damage = (u16)MYMIN(damage_f + 0.5, U16_MAX);
if (damage != 0) {
if (!g_settings->getBool("prevent_natural_damage") != 0) {
damageLocalPlayer(damage, true);
yeah stupid, stupid cora :/
closed in shame. made a 2nd one with the correct changes lol
Pull request closed