-void target_music_sendto(float to, float is)
-{SELFPARAM();
- WriteByte(to, SVC_TEMPENTITY);
- WriteByte(to, TE_CSQC_TARGET_MUSIC);
- WriteShort(to, num_for_edict(self));
- WriteByte(to, self.volume * 255.0 * is);
- WriteByte(to, self.fade_time * 16.0);
- WriteByte(to, self.fade_rate * 16.0);
- WriteByte(to, self.lifetime);
- WriteString(to, self.noise);
+void target_music_sendto(entity this, int to, bool is)
+{
+ WriteHeader(to, TE_CSQC_TARGET_MUSIC);
+ WriteShort(to, etof(this));
+ WriteByte(to, this.volume * 255.0 * is);
+ WriteByte(to, this.fade_time * 16.0);
+ WriteByte(to, this.fade_rate * 16.0);
+ WriteByte(to, this.lifetime);
+ WriteString(to, this.noise);
+}
+void target_music_reset(entity this)
+{
+ if (this.targetname == "") target_music_sendto(this, MSG_ALL, 1);