1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Don't call on_dieplayer callback two times (#11874)

This commit is contained in:
savilli 2022-01-15 17:44:55 +01:00 committed by GitHub
parent 76e97e85a0
commit 72b14bd994
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 60 deletions

View file

@ -819,8 +819,7 @@ void Server::handleCommand_Damage(NetworkPacket* pkt)
<< std::endl;
PlayerHPChangeReason reason(PlayerHPChangeReason::FALL);
playersao->setHP((s32)playersao->getHP() - (s32)damage, reason, false);
SendPlayerHPOrDie(playersao, reason); // correct client side prediction
playersao->setHP((s32)playersao->getHP() - (s32)damage, reason, true);
}
}