]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Play a sound when the power fails
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 21:09:05 +0000 (23:09 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 15 Nov 2011 21:09:05 +0000 (23:09 +0200)
data/qcsrc/server/cl_client.qc
data/sound/misc/power_fail.ogg [new file with mode: 0644]

index ed742266b625f50ad5276a23afa8af107cb07c4a..58814dacf104edadae611f9432f5d4e66b13ea38 100644 (file)
@@ -2446,6 +2446,7 @@ Called every frame for each client before the physics are run
 void() ctf_setstatus;\r
 .float items_added;\r
 .vector avg_vel;\r
+.float power_sounded;\r
 void PlayerPreThink (void)\r
 {\r
        self.stat_game_starttime = game_starttime;\r
@@ -2476,6 +2477,18 @@ void PlayerPreThink (void)
        // core code for the vore system\r
        Vore();\r
 \r
+       // play power fail sound\r
+       if(self.armorvalue < cvar("g_power"))\r
+       {\r
+               if(!self.power_sounded)\r
+               {\r
+                       sound(self, CHAN_TRIGGER, "sound/misc/power_fail.ogg", VOL_BASE, ATTN_NONE);\r
+                       self.power_sounded = TRUE;\r
+               }\r
+       }\r
+       else\r
+               self.power_sounded = FALSE;\r
+\r
        // version nagging\r
        if(self.version_nagtime)\r
                if(self.cvar_g_voretournamentversion)\r
diff --git a/data/sound/misc/power_fail.ogg b/data/sound/misc/power_fail.ogg
new file mode 100644 (file)
index 0000000..f1ef148
Binary files /dev/null and b/data/sound/misc/power_fail.ogg differ