From: MirceaKitsune Date: Sat, 30 Oct 2010 21:06:12 +0000 (+0300) Subject: Simplify fall damage sound, as done in Xonotic X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=068600a5a828951bbe029ddbb2b3cb21440bc6f8 Simplify fall damage sound, as done in Xonotic --- diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 740cc6a9..932d0b96 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -486,14 +486,17 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht } if(sound_allowed(MSG_BROADCAST, attacker)) + if(self.health > 1) { - if(self.health > 75) // TODO make a "gentle" version? + if(deathtype == DEATH_FALL) + PlayerSound(self, playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND); + else if(self.health > 75) // TODO make a "gentle" version? PlayerSound(self, playersound_pain100, CHAN_PAIN, VOICETYPE_PLAYERSOUND); else if(self.health > 50) PlayerSound(self, playersound_pain75, CHAN_PAIN, VOICETYPE_PLAYERSOUND); else if(self.health > 25) PlayerSound(self, playersound_pain50, CHAN_PAIN, VOICETYPE_PLAYERSOUND); - else if(self.health > 1) + else PlayerSound(self, playersound_pain25, CHAN_PAIN, VOICETYPE_PLAYERSOUND); } } diff --git a/data/qcsrc/server/sv_main.qc b/data/qcsrc/server/sv_main.qc index 02ebff8c..1a26c72f 100644 --- a/data/qcsrc/server/sv_main.qc +++ b/data/qcsrc/server/sv_main.qc @@ -75,13 +75,7 @@ void CreatureFrame (void) else dm = min((dm - cvar("g_balance_falldamage_minspeed")) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage")); 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(self, playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND); - } else if(vlen(self.velocity) > 100000 && cvar("developer")) { dprint(strcat(self.netname, " became too fast, please investigate: ", vtos(self.spawnorigin), "\n"));