X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Ftarget_music.qc;h=daab6469981c021bf8224e4bf5816a9705876d08;hb=fb68727685088a166e860276f116be6f75cf2d98;hp=a17cc41805e8626cb0131379635158a3d805f93e;hpb=37b903eeaeee1fc1662556a56cdcf19881abbeeb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/target_music.qc b/qcsrc/server/target_music.qc index a17cc4180..daab64699 100644 --- a/qcsrc/server/target_music.qc +++ b/qcsrc/server/target_music.qc @@ -10,6 +10,7 @@ // when targetname is not set, THIS ONE is default void target_music_sendto(float to, float is) { + WriteByte(to, SVC_TEMPENTITY); WriteByte(to, TE_CSQC_TARGET_MUSIC); WriteShort(to, num_for_edict(self)); WriteByte(to, self.volume * 255.0 * is); @@ -41,6 +42,16 @@ void spawnfunc_target_music() else target_music_sendto(MSG_INIT, 0); } +void TargetMusic_RestoreGame() +{ + for(self = world; (self = find(self, classname, "target_music")); ) + { + if(self.targetname == "") + target_music_sendto(MSG_INIT, 1); + else + target_music_sendto(MSG_INIT, 0); + } +} // values: // volume // noise @@ -51,7 +62,7 @@ void spawnfunc_target_music() // when triggered, it is disabled/enabled for everyone float trigger_music_SendEntity(entity to, float sf) { - WriteByte(MSG_ENTITY, TE_CSQC_TARGET_MUSIC); + WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC); sf &~= 0x80; if(self.cnt) sf |= 0x80;