]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Hack: mute all target_music entities when the match ends (fixes overlapping with...
authorMario <mario@smbclan.net>
Thu, 15 Oct 2015 02:56:47 +0000 (12:56 +1000)
committerMario <mario@smbclan.net>
Thu, 15 Oct 2015 02:56:47 +0000 (12:56 +1000)
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/music.qh
qcsrc/server/g_world.qc
qcsrc/server/t_items.qc

index 257de8be5708c52bf2a11e1410f7173a179fa53a..ebecb18e317e3da64b8999a4624914722d298a0a 100644 (file)
@@ -33,6 +33,17 @@ void target_music_reset()
        if(self.targetname == "")
                target_music_sendto(MSG_ALL, 1);
 }
+void target_music_kill()
+{
+       for(self = world; (self = find(self, classname, "target_music")); )
+       {
+               self.volume = 0;
+               if(self.targetname == "")
+                       target_music_sendto(MSG_ALL, 1);
+               else
+                       target_music_sendto(MSG_ALL, 0);
+       }
+}
 void target_music_use()
 {
        if(!activator)
index 712d412f6ac4b003daee36eca37de96aa33b804a..d46c460554c83d26829ecc0083cec760926017e4 100644 (file)
@@ -23,6 +23,9 @@ void Ent_TriggerMusic_Think();
 void Ent_TriggerMusic_Remove();
 
 void Ent_ReadTriggerMusic();
+
+#elif defined(SVQC)
+void target_music_kill();
 #endif
 
 #endif
index fc3eed45286cd110e4a697a050d40cbd0f3b63a3..d570cad530e9c18a8d7c99914e95283e89108228 100644 (file)
@@ -31,6 +31,7 @@
 #include "../common/stats.qh"
 #include "../common/teams.qh"
 #include "../common/triggers/trigger/secret.qh"
+#include "../common/triggers/target/music.qh"
 #include "../common/util.qh"
 #include "../common/items/all.qh"
 #include "../common/weapons/all.qh"
@@ -1546,6 +1547,10 @@ void NextLevel()
                        bprint(other.netname, " ^7wins.\n");
        }
 
+       entity oldself = self;
+       target_music_kill();
+       self = oldself;
+
        if(autocvar_g_campaign)
                CampaignPreIntermission();
 
index a640cce105a46f39b95d18b90fd6adedc0f860e5..568789c623afaafbb8cf24cda4c7a01d8a5a5002 100644 (file)
@@ -1070,12 +1070,12 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                // it's a level item
                if(self.spawnflags & 1)
                        self.noalign = 1;
-               if (self.noalign)
+               if (self.noalign > 0)
                        self.movetype = MOVETYPE_NONE;
                else
                        self.movetype = MOVETYPE_TOSS;
                // do item filtering according to game mode and other things
-               if (!self.noalign)
+               if (self.noalign <= 0)
                {
                        // first nudge it off the floor a little bit to avoid math errors
                        setorigin(self, self.origin + '0 0 1');
@@ -1086,7 +1086,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                                setsize (self, '-16 -16 0', '16 16 32');
                        self.SendFlags |= ISF_SIZE;
                        // note droptofloor returns false if stuck/or would fall too far
-                       droptofloor();
+                       if(!self.noalign)
+                               droptofloor();
                        waypoint_spawnforitem(self);
                }