aboutsummaryrefslogtreecommitdiff
path: root/src/network/serverpackethandler.cpp
diff options
context:
space:
mode:
authorsavilli <78875209+savilli@users.noreply.github.com>2021-10-12 21:12:49 +0300
committerGitHub <noreply@github.com>2021-10-12 20:12:49 +0200
commit6ea558f8ac57a391b6f54c534441f930b0609cea (patch)
tree7d995996bfb6acfa9fb13a76419c3d09dd72a40e /src/network/serverpackethandler.cpp
parentecc6f4ba25cd49599922333a5f8d4b4ce368992d (diff)
downloadminetest-6ea558f8ac57a391b6f54c534441f930b0609cea.tar.gz
minetest-6ea558f8ac57a391b6f54c534441f930b0609cea.tar.bz2
minetest-6ea558f8ac57a391b6f54c534441f930b0609cea.zip
Fix player HP desync between client and server
Diffstat (limited to 'src/network/serverpackethandler.cpp')
-rw-r--r--src/network/serverpackethandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index 4c609644f..dc7be0e23 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -826,7 +826,8 @@ void Server::handleCommand_Damage(NetworkPacket* pkt)
<< std::endl;
PlayerHPChangeReason reason(PlayerHPChangeReason::FALL);
- playersao->setHP((s32)playersao->getHP() - (s32)damage, reason);
+ playersao->setHP((s32)playersao->getHP() - (s32)damage, reason, false);
+ SendPlayerHPOrDie(playersao, reason); // correct client side prediction
}
}