From ffb17f1c9a203fea6de70159b461f52d104e05b9 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Mon, 11 Feb 2019 00:03:26 +0100 Subject: Consistent HP and damage types (#8167) Remove deprecated HUDs and chat message handling. Remove unused m_damage variable (compat break). HP: s32 for setter/calculations, u16 for getter. --- src/network/serverpackethandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/network') diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 138cf3edb..6f17d666a 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -776,7 +776,7 @@ void Server::handleCommand_ChatMessage(NetworkPacket* pkt) void Server::handleCommand_Damage(NetworkPacket* pkt) { - u8 damage; + u16 damage; *pkt >> damage; @@ -812,7 +812,7 @@ void Server::handleCommand_Damage(NetworkPacket* pkt) << std::endl; PlayerHPChangeReason reason(PlayerHPChangeReason::FALL); - playersao->setHP(playersao->getHP() - damage, reason); + playersao->setHP((s32)playersao->getHP() - (s32)damage, reason); SendPlayerHPOrDie(playersao, reason); } } @@ -1169,8 +1169,8 @@ void Server::handleCommand_Interact(NetworkPacket* pkt) float time_from_last_punch = playersao->resetTimeFromLastPunch(); - s16 src_original_hp = pointed_object->getHP(); - s16 dst_origin_hp = playersao->getHP(); + u16 src_original_hp = pointed_object->getHP(); + u16 dst_origin_hp = playersao->getHP(); pointed_object->punch(dir, &toolcap, playersao, time_from_last_punch); -- cgit v1.2.3