1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-12-07 07:55:27 +01: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
9 changed files with 23 additions and 11 deletions

View File

@@ -570,6 +570,10 @@ void Client::handleCommand_HP(NetworkPacket *pkt)
u16 hp;
*pkt >> hp;
bool damage_effect = true;
try {
*pkt >> damage_effect;
} catch (PacketError &e) {};
player->hp = hp;
@@ -581,6 +585,7 @@ void Client::handleCommand_HP(NetworkPacket *pkt)
ClientEvent *event = new ClientEvent();
event->type = CE_PLAYER_DAMAGE;
event->player_damage.amount = oldhp - hp;
event->player_damage.effect = damage_effect;
m_client_event_queue.push(event);
}
}