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

Play player_damage.ogg when recieving damage and additionally play player_falling_damage.ogg when recieving falling damage

This commit is contained in:
PilzAdam 2013-04-17 20:13:47 +02:00
parent 773471750d
commit 2cdf0ff4ab
2 changed files with 22 additions and 1 deletions

View file

@ -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);
}
}
}