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/client/content_cao.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/client/content_cao.cpp') diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index 6112edaff..8643b5824 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -371,7 +371,7 @@ void GenericCAO::processInitData(const std::string &data) m_id = readU16(is); m_position = readV3F32(is); m_rotation = readV3F32(is); - m_hp = readS16(is); + m_hp = readU16(is); const u8 num_messages = readU8(is); for (int i = 0; i < num_messages; i++) { @@ -1508,11 +1508,10 @@ void GenericCAO::processMessage(const std::string &data) updateAttachments(); } else if (cmd == GENERIC_CMD_PUNCHED) { - /*s16 damage =*/ readS16(is); - s16 result_hp = readS16(is); + u16 result_hp = readU16(is); // Use this instead of the send damage to not interfere with prediction - s16 damage = m_hp - result_hp; + s32 damage = (s32)m_hp - (s32)result_hp; m_hp = result_hp; -- cgit v1.2.3