]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Part 2: Code the falling sound (when you take falling damage, play the fall playersou...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 22:07:53 +0000 (01:07 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 22:07:53 +0000 (01:07 +0300)
qcsrc/server/defs.qh
qcsrc/server/sv_main.qc

index f084e18d4b0b69f6a92b5009321e419e583145c5..38ce207ddd0820dfdefa9e0b7b95323de9a0cc27 100644 (file)
@@ -436,6 +436,7 @@ float next_pingtime;
 // TODO implemented fall and falling
 #define ALLPLAYERSOUNDS \
                _VOICEMSG(death) \
+               _VOICEMSG(fall) \
                _VOICEMSG(drown) \
                _VOICEMSG(gasp) \
                _VOICEMSG(jump) \
index 44a47c95dc5ed653c2cf40afb68bf7c788570b5d..3b7d77d58be6ef819dfcd4ae68266588e1ed36fc 100644 (file)
@@ -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);
                                }
                        }