From: MirceaKitsune Date: Tue, 15 Nov 2011 21:09:05 +0000 (+0200) Subject: Play a sound when the power fails X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=51bb2e41272982857f94fd035aa358e161f3123b;p=voretournament%2Fvoretournament.git Play a sound when the power fails --- diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index ed742266..58814dac 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2446,6 +2446,7 @@ Called every frame for each client before the physics are run void() ctf_setstatus; .float items_added; .vector avg_vel; +.float power_sounded; void PlayerPreThink (void) { self.stat_game_starttime = game_starttime; @@ -2476,6 +2477,18 @@ void PlayerPreThink (void) // core code for the vore system Vore(); + // play power fail sound + if(self.armorvalue < cvar("g_power")) + { + if(!self.power_sounded) + { + sound(self, CHAN_TRIGGER, "sound/misc/power_fail.ogg", VOL_BASE, ATTN_NONE); + self.power_sounded = TRUE; + } + } + else + self.power_sounded = FALSE; + // version nagging if(self.version_nagtime) if(self.cvar_g_voretournamentversion) diff --git a/data/sound/misc/power_fail.ogg b/data/sound/misc/power_fail.ogg new file mode 100644 index 00000000..f1ef1483 Binary files /dev/null and b/data/sound/misc/power_fail.ogg differ