From: Mario Date: Thu, 15 Oct 2015 02:56:47 +0000 (+1000) Subject: Hack: mute all target_music entities when the match ends (fixes overlapping with... X-Git-Tag: xonotic-v0.8.2~1816 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=a3d5a1b1e21275e2ee233228561b8199d4332d45 Hack: mute all target_music entities when the match ends (fixes overlapping with sv_intermission_cdtrack) --- diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 257de8be57..ebecb18e31 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -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) diff --git a/qcsrc/common/triggers/target/music.qh b/qcsrc/common/triggers/target/music.qh index 712d412f6a..d46c460554 100644 --- a/qcsrc/common/triggers/target/music.qh +++ b/qcsrc/common/triggers/target/music.qh @@ -23,6 +23,9 @@ void Ent_TriggerMusic_Think(); void Ent_TriggerMusic_Remove(); void Ent_ReadTriggerMusic(); + +#elif defined(SVQC) +void target_music_kill(); #endif #endif diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index fc3eed4528..d570cad530 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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(); diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index a640cce105..568789c623 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -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); }