mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix player HP desync between client and server
This commit is contained in:
parent
ecc6f4ba25
commit
6ea558f8ac
3 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue