diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-04-17 20:13:47 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-06-12 20:27:06 +0000 |
commit | 2cdf0ff4abaa045545440c8694b47371766a7b64 (patch) | |
tree | 1b01148e29b36a63d40449d17d83edb875fcb87d /src/environment.cpp | |
parent | 773471750dbea73431934ac3736c23564da986b5 (diff) | |
download | hax-minetest-server-2cdf0ff4abaa045545440c8694b47371766a7b64.tar.gz hax-minetest-server-2cdf0ff4abaa045545440c8694b47371766a7b64.zip |
Play player_damage.ogg when recieving damage and additionally play player_falling_damage.ogg when recieving falling damage
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index ab6a6d3d3..af05371ca 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -40,6 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef SERVER #include "clientmap.h" #include "localplayer.h" +#include "event.h" #endif #include "daynightratio.h" #include "map.h" @@ -2190,8 +2191,11 @@ void ClientEnvironment::step(float dtime) { f32 damage_f = (speed - tolerance)/BS * post_factor; u16 damage = (u16)(damage_f+0.5); - if(damage != 0) + if(damage != 0){ damageLocalPlayer(damage, true); + MtEvent *e = new SimpleTriggerEvent("PlayerFallingDamage"); + m_gamedef->event()->put(e); + } } } |