From: Rudolf Polzer Date: Sun, 5 Dec 2010 17:29:42 +0000 (+0100) Subject: support ready-restart with the toggling speaker target X-Git-Tag: xonotic-v0.1.0preview~69^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cc641f4477bf6499ed60402a09ecb6a9b3eb10ae;p=xonotic%2Fxonotic-data.pk3dir.git support ready-restart with the toggling speaker target --- diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index cadc1fb70..719ff653d 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -719,6 +719,19 @@ void target_speaker_use_off() sound(self, CHAN_TRIGGER, "misc/null.wav", VOL_BASE * self.volume, self.atten); self.use = target_speaker_use_on; } +void target_speaker_reset() +{ + if(self.spawnflags & 1) // LOOPED_ON + { + if(self.use == target_speaker_use_on) + target_speaker_use_on(); + } + else if(self.spawnflags & 2) + { + if(self.use == target_speaker_use_off) + target_speaker_use_off(); + } +} void spawnfunc_target_speaker() { @@ -745,7 +758,15 @@ void spawnfunc_target_speaker() if(self.spawnflags & 8) // ACTIVATOR self.use = target_speaker_use_activator; else if(self.spawnflags & 1) // LOOPED_ON + { target_speaker_use_on(); + self.reset = target_speaker_reset; + } + else if(self.spawnflags & 2) // LOOPED_OFF + { + self.use = target_speaker_use_on; + self.reset = target_speaker_reset; + } else self.use = target_speaker_use_on; }