aboutsummaryrefslogtreecommitdiff
path: root/src/client/content_cao.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-02-11 00:03:26 +0100
committerParamat <paramat@users.noreply.github.com>2019-02-10 23:03:26 +0000
commitffb17f1c9a203fea6de70159b461f52d104e05b9 (patch)
treeca2c9f26515b8c6dad2a42b7e09f5d2a91d6f398 /src/client/content_cao.cpp
parentba5a9f2b361a2fa01d1a3396999a5833983c0f4a (diff)
downloaddragonfireclient-ffb17f1c9a203fea6de70159b461f52d104e05b9.tar.xz
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.
Diffstat (limited to 'src/client/content_cao.cpp')
-rw-r--r--src/client/content_cao.cpp7
1 files changed, 3 insertions, 4 deletions
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;