float magicear_matched;
float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorepitch, float mintempo, float maxtempo);
string trigger_magicear_processmessage(entity ear, entity source, float teamsay, entity privatesay, string msgin)
-{
+{SELFPARAM();
float domatch, dotrigger, matchstart, l;
string s, msg;
- entity oldself;
string savemessage;
magicear_matched = false;
- dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius)));
+ dotrigger = ((IS_PLAYER(source)) && (!IS_DEAD(source)) && ((ear.radius == 0) || (vdist(source.origin - ear.origin, <=, ear.radius))));
domatch = ((ear.spawnflags & 32) || dotrigger);
if (!domatch)
if(dotrigger)
{
- oldself = self;
- activator = source;
- self = ear;
savemessage = self.message;
self.message = string_null;
- SUB_UseTargets();
+ SUB_UseTargets(ear, source, NULL);
self.message = savemessage;
- self = oldself;
}
if(ear.netname != "")
if(dotrigger)
{
- oldself = self;
- activator = source;
- self = ear;
savemessage = self.message;
self.message = string_null;
- SUB_UseTargets();
+ SUB_UseTargets(ear, source, NULL);
self.message = savemessage;
- self = oldself;
}
if(ear.spawnflags & 16)
return msgin;
}
-void spawnfunc_trigger_magicear()
+spawnfunc(trigger_magicear)
{
self.enemy = magicears;
magicears = self;