From: Mircea Kitsune Date: Mon, 4 Oct 2010 22:07:53 +0000 (+0300) Subject: Part 2: Code the falling sound (when you take falling damage, play the fall playersou... X-Git-Tag: xonotic-v0.1.0preview~282^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e0e52abdb109c9923e6f79438e50d1fc7656fe2;p=xonotic%2Fxonotic-data.pk3dir.git Part 2: Code the falling sound (when you take falling damage, play the fall playersound instead of the normal pain sounds, which sounds a lot better imo). --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f084e18d4..38ce207dd 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -436,6 +436,7 @@ float next_pingtime; // TODO implemented fall and falling #define ALLPLAYERSOUNDS \ _VOICEMSG(death) \ + _VOICEMSG(fall) \ _VOICEMSG(drown) \ _VOICEMSG(gasp) \ _VOICEMSG(jump) \ diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 44a47c95d..3b7d77d58 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -77,6 +77,10 @@ void CreatureFrame (void) if (dm > 0) { Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0'); + // this must be allowed to cut the normal pain sounds (played after them and on the same channel) + // there's no way to detect falling damage and prevent the pain sounds for this to be played instead + if(self.health > 0) + PlayerSound(playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND); } }