diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2022-06-11 20:00:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 20:00:40 +0200 |
commit | f4a53f7ee6fb5482f8193353c35be54b40533d6f (patch) | |
tree | fbbf1f323a0f0340e9f07c851bfba7c23e30b670 /src/client | |
parent | 3eafcab64ecaf8d00a9264b441e996825a6a31bd (diff) | |
download | minetest-f4a53f7ee6fb5482f8193353c35be54b40533d6f.tar.gz minetest-f4a53f7ee6fb5482f8193353c35be54b40533d6f.tar.bz2 minetest-f4a53f7ee6fb5482f8193353c35be54b40533d6f.zip |
No damage effects on hp_max change (#11846)
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.cpp | 1 | ||||
-rw-r--r-- | src/client/clientevent.h | 1 | ||||
-rw-r--r-- | src/client/game.cpp | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index d81ee434e..37d4bd816 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -493,6 +493,7 @@ void Client::step(float dtime) ClientEvent *event = new ClientEvent(); event->type = CE_PLAYER_DAMAGE; event->player_damage.amount = damage; + event->player_damage.effect = true; m_client_event_queue.push(event); } } diff --git a/src/client/clientevent.h b/src/client/clientevent.h index 17d3aedd6..243a94596 100644 --- a/src/client/clientevent.h +++ b/src/client/clientevent.h @@ -87,6 +87,7 @@ struct ClientEvent struct { u16 amount; + bool effect; } player_damage; struct { diff --git a/src/client/game.cpp b/src/client/game.cpp index 441054631..5db472ee0 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -2605,6 +2605,9 @@ void Game::handleClientEvent_PlayerDamage(ClientEvent *event, CameraOrientation if (client->modsLoaded()) client->getScript()->on_damage_taken(event->player_damage.amount); + if (!event->player_damage.effect) + return; + // Damage flash and hurt tilt are not used at death if (client->getHP() > 0) { LocalPlayer *player = client->getEnv().getLocalPlayer(); |