1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

No damage effects on hp_max change (#11846)

This commit is contained in:
Lars Müller 2022-06-11 20:00:40 +02:00 committed by GitHub
parent 3eafcab64e
commit f4a53f7ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 11 deletions

View file

@ -495,7 +495,7 @@ void PlayerSAO::setHP(s32 target_hp, const PlayerHPChangeReason &reason, bool fr
m_hp = hp;
m_env->getGameDef()->HandlePlayerHPChange(this, reason);
} else if (from_client)
m_env->getGameDef()->SendPlayerHP(this);
m_env->getGameDef()->SendPlayerHP(this, true);
}
void PlayerSAO::setBreath(const u16 breath, bool send)

View file

@ -235,6 +235,7 @@ struct PlayerHPChangeReason
enum Type : u8
{
SET_HP,
SET_HP_MAX, // internal type to allow distinguishing hp reset and damage (for effects)
PLAYER_PUNCH,
FALL,
NODE_DAMAGE,
@ -277,6 +278,7 @@ struct PlayerHPChangeReason
{
switch (type) {
case PlayerHPChangeReason::SET_HP:
case PlayerHPChangeReason::SET_HP_MAX:
return "set_hp";
case PlayerHPChangeReason::PLAYER_PUNCH:
return "punch";