diff options
author | savilli <78875209+savilli@users.noreply.github.com> | 2021-10-12 21:12:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 20:12:49 +0200 |
commit | 6ea558f8ac57a391b6f54c534441f930b0609cea (patch) | |
tree | 7d995996bfb6acfa9fb13a76419c3d09dd72a40e /src/network/serverpackethandler.cpp | |
parent | ecc6f4ba25cd49599922333a5f8d4b4ce368992d (diff) | |
download | minetest-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.cpp | 3 |
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 } } |