self.state = STATE_TOP;
self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait;
self.SUB_THINK = button_return;
- activator = self.enemy;
- SUB_UseTargets();
+ SUB_UseTargets(self, self.enemy, NULL);
self.frame = 1; // use alternate textures
}
self.takedamage = DAMAGE_YES; // can be shot again
}
-void button_use()
-{SELFPARAM();
- if(self.active != ACTIVE_ACTIVE)
+void button_use(entity this, entity actor, entity trigger)
+{
+ if(this.active != ACTIVE_ACTIVE)
return;
- self.enemy = activator;
- button_fire ();
+ this.enemy = actor;
+ WITHSELF(this, button_fire());
}
void button_touch()
button_fire ();
}
-void button_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
- if(self.spawnflags & DOOR_NOSPLASH)
+void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+ if(this.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
- self.health = self.health - damage;
- if (self.health <= 0)
+ this.health = this.health - damage;
+ if (this.health <= 0)
{
- self.enemy = damage_attacker;
- button_fire ();
+ this.enemy = damage_attacker;
+ WITHSELF(this, button_fire());
}
}