}
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);
- }
+ FOREACH_ENTITY_CLASS("target_music", true, {
+ it.volume = 0;
+ if (it.targetname == "")
+ WITHSELF(it, target_music_sendto(MSG_ALL, 1));
+ else
+ WITHSELF(it, target_music_sendto(MSG_ALL, 0));
+ });
}
-void target_music_use()
+void target_music_use(entity this, entity actor, entity trigger)
{
- if(!activator)
+ if(!actor)
return;
- if(IS_REAL_CLIENT(activator))
+ if(IS_REAL_CLIENT(actor))
{
- msg_entity = activator;
+ msg_entity = actor;
target_music_sendto(MSG_ONE, 1);
}
- FOREACH_CLIENT(IS_SPEC(it) && it.enemy == activator, {
+ FOREACH_CLIENT(IS_SPEC(it) && it.enemy == actor, {
msg_entity = it;
target_music_sendto(MSG_ONE, 1);
});
this.cnt = !(this.spawnflags & 1);
this.SendFlags |= 0x80;
}
-void trigger_music_use()
-{SELFPARAM();
- self.cnt = !self.cnt;
- self.SendFlags |= 0x80;
+void trigger_music_use(entity this, entity actor, entity trigger)
+{
+ this.cnt = !this.cnt;
+ this.SendFlags |= 0x80;
}
spawnfunc(trigger_music)
{