]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
There's smoke in the master bedroom.
authorRudolf Polzer <divverent@xonotic.org>
Sat, 21 Feb 2015 12:56:07 +0000 (13:56 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 21 Feb 2015 12:57:03 +0000 (13:57 +0100)
In other words: func_breakable.sound1 support.

qcsrc/server/func_breakable.qc

index c0e54d11671093d0201ed5d51cd389d4d4859406..3acf9157bc36a1924992611aa76509d78cef9c3c 100644 (file)
@@ -120,6 +120,14 @@ void func_breakable_behave_destroyed()
        self.event_damage = func_null;
        self.state = 1;
        func_breakable_colormod();
+       if (self.noise1)
+       {
+               stopsoundto (MSG_BROADCAST, self, CH_TRIGGER);
+               // Only also send a reliable stop if self.noise is unused.
+               // Otherwise we may be stopping the destroy sound too.
+               if (!self.noise)
+                       stopsoundto (MSG_ALL, self, CH_TRIGGER);
+       }
 }
 
 void func_breakable_behave_restore()
@@ -136,6 +144,8 @@ void func_breakable_behave_restore()
        self.state = 0;
        self.nextthink = 0; // cancel auto respawn
        func_breakable_colormod();
+       if (self.noise1)
+               sound (self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
 }
 
 void func_breakable_destroyed()
@@ -270,6 +280,8 @@ void spawnfunc_func_breakable() {
                precache_model(argv(i));
        if(self.noise)
                precache_sound(self.noise);
+       if(self.noise1)
+               precache_sound(self.noise1);
 
        self.team_saved = self.team;
        self.dropped_origin = self.origin;