]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If teleporter has .noise set, use that sound instead
authorMario <mario@smbclan.net>
Fri, 1 Jan 2016 12:52:44 +0000 (22:52 +1000)
committerMario <mario@smbclan.net>
Fri, 1 Jan 2016 12:52:44 +0000 (22:52 +1000)
qcsrc/common/constants.qh
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/teleport.qc

index 4bffd04baa2e9983091f42b198d980678f87063b..b2302f6d2ebe1ae176504985baec7cac4beccac0 100644 (file)
@@ -223,6 +223,8 @@ const int WATERLEVEL_NONE = 0;
 const int WATERLEVEL_WETFEET = 1;
 const int WATERLEVEL_SWIMMING = 2;
 const int WATERLEVEL_SUBMERGED = 3;
+
+// server flags
 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
 const int SERVERFLAG_TEAMPLAY = 2;
 const int SERVERFLAG_PLAYERSTATS = 4;
index b4dc20a7d767aacb9c5b5a496c3a4b3d3f0cdc25..2d23dd636b8981aa9982643be5abc3c6611ad465 100644 (file)
@@ -85,7 +85,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
                {
                        if(tflags & TELEPORT_FLAG_SOUND)
-                               sound (player, CH_TRIGGER, SND_TELEPORT, VOL_BASE, ATTEN_NORM);
+                               sound (player, CH_TRIGGER, ((teleporter.noise != "") ? teleporter.noise : SND_TELEPORT), VOL_BASE, ATTEN_NORM);
                        if(tflags & TELEPORT_FLAG_PARTICLES)
                        {
                                Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1);
index c013eb867fa446e1175f383dd50dc2f159e75f86..37c4d1def7b0a82f0ed76910ac1bcc817d94a858 100644 (file)
@@ -86,6 +86,9 @@ spawnfunc(trigger_teleport)
        trigger_init(self);
        self.use = trigger_teleport_use;
 
+       if(self.noise != "")
+               precache_sound(self.noise);
+
        // this must be called to spawn the teleport waypoints for bots
        InitializeEntity(self, teleport_findtarget, INITPRIO_FINDTARGET);