1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

Fix player HP desync between client and server

This commit is contained in:
savilli
2021-10-12 21:12:49 +03:00
committed by GitHub
parent ecc6f4ba25
commit 6ea558f8ac
3 changed files with 10 additions and 4 deletions

View File

@@ -112,7 +112,11 @@ public:
u16 punch(v3f dir, const ToolCapabilities *toolcap, ServerActiveObject *puncher,
float time_from_last_punch);
void rightClick(ServerActiveObject *clicker);
void setHP(s32 hp, const PlayerHPChangeReason &reason);
void setHP(s32 hp, const PlayerHPChangeReason &reason) override
{
return setHP(hp, reason, true);
}
void setHP(s32 hp, const PlayerHPChangeReason &reason, bool send);
void setHPRaw(u16 hp) { m_hp = hp; }
u16 getBreath() const { return m_breath; }
void setBreath(const u16 breath, bool send = true);