mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-29 20:25:19 +01:00
Fix player HP desync between client and server
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user