summaryrefslogtreecommitdiff
path: root/src/remoteplayer.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/remoteplayer.cpp
parentba5a9f2b361a2fa01d1a3396999a5833983c0f4a (diff)
downloadminetest-ffb17f1c9a203fea6de70159b461f52d104e05b9.tar.gz
minetest-ffb17f1c9a203fea6de70159b461f52d104e05b9.tar.bz2
minetest-ffb17f1c9a203fea6de70159b461f52d104e05b9.zip
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/remoteplayer.cpp')
-rw-r--r--src/remoteplayer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/remoteplayer.cpp b/src/remoteplayer.cpp
index fa2200e94..5443b7a2d 100644
--- a/src/remoteplayer.cpp
+++ b/src/remoteplayer.cpp
@@ -98,7 +98,7 @@ void RemotePlayer::deSerialize(std::istream &is, const std::string &playername,
if (sao) {
try {
- sao->setHPRaw(args.getS32("hp"));
+ sao->setHPRaw(args.getU16("hp"));
} catch(SettingNotFoundException &e) {
sao->setHPRaw(PLAYER_MAX_HP_DEFAULT);
}
@@ -115,7 +115,7 @@ void RemotePlayer::deSerialize(std::istream &is, const std::string &playername,
} catch (SettingNotFoundException &e) {}
try {
- sao->setBreath(args.getS32("breath"), false);
+ sao->setBreath(args.getU16("breath"), false);
} catch (SettingNotFoundException &e) {}
try {
@@ -168,11 +168,11 @@ void RemotePlayer::serialize(std::ostream &os)
// This should not happen
assert(m_sao);
- args.setS32("hp", m_sao->getHP());
+ args.setU16("hp", m_sao->getHP());
args.setV3F("position", m_sao->getBasePosition());
args.setFloat("pitch", m_sao->getLookPitch());
args.setFloat("yaw", m_sao->getRotation().Y);
- args.setS32("breath", m_sao->getBreath());
+ args.setU16("breath", m_sao->getBreath());
std::string extended_attrs;
serializeExtraAttributes(extended_attrs);