return false;
}
- void ons_MonsterSpawn_Delayed()
- {SELFPARAM();
- entity own = this.owner;
+ void ons_MonsterSpawn_Delayed(entity this)
+ {
- entity e, own = self.owner;
++ entity own = self.owner;
- if(!own) { remove(self); return; }
+ if(!own) { remove(this); return; }
if(own.targetname)
{
return false;
}
- void ons_TurretSpawn_Delayed()
- {SELFPARAM();
+ void ons_TurretSpawn_Delayed(entity this)
+ {
- entity e, own = self.owner;
+ entity own = self.owner;
if(!own) { remove(self); return; }
this.trigger_touch = door_touch;
this.draw = door_draw;
this.drawmask = MASK_NORMAL;
- this.use = door_use;
+ this.use1 = door_use;
- LinkDoors();
+ LinkDoors(this);
if(this.spawnflags & DOOR_START_OPEN)
- door_init_startopen();
+ door_init_startopen(this);
this.move_time = time;
this.move_origin = this.origin;
//Net_LinkEntity(self, 0, false, train_send);
}
-void train_use()
+void train_use(entity this, entity actor, entity trigger)
{
- SELFPARAM();
- self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
- self.SUB_THINK = train_next;
- self.use = func_null; // not again
+ this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
+ this.SUB_THINK = train_next;
+ this.use1 = func_null; // not again
}
- void func_train_find()
- {SELFPARAM();
+ void func_train_find(entity this)
+ {
entity targ;
targ = find(world, targetname, self.target);
self.target = targ.target;
}
}
- void target_spawn_spawnfirst()
- {SELFPARAM();
- entity act = self.target_spawn_activator;
- if(self.spawnflags & 2)
+ void target_spawn_spawnfirst(entity this)
+ {
- activator = self.target_spawn_activator;
- if(self.spawnflags & 2)
- target_spawn_use();
++ entity act = this.target_spawn_activator;
++ if(this.spawnflags & 2)
+ target_spawn_use(this, act, NULL);
}
void initialize_field_db()
#endif
// Step 6: Remove SELFPARAM in favor of a parameter
-.void(entity this) selfuse;
-void use_self() { SELFPARAM(); this.selfuse(this); }
-#define setuse(e, f) (e.use = use_self, e.selfuse = f)
+
+ .void(entity this) selftouch;
+ void touch_self() { SELFPARAM(); this.selftouch(this); }
+ #define settouch(e, f) (e.touch = touch_self, e.selftouch = f)
+
++//.void(entity this) selfuse;
++//void use_self() { SELFPARAM(); this.selfuse(this); }
++//#define setuse(e, f) (e.use = use_self, e.selfuse = f)
+
+ .void(entity this) selfthink;
+ void think_self() { SELFPARAM(); this.selfthink(this); }
+ #define setthink(e, f) (e.think = think_self, e.selfthink = f)
.float modelscale;
-void g_model_setcolormaptoactivator ()
-{SELFPARAM();
+void g_model_setcolormaptoactivator(entity this, entity actor, entity trigger)
+{
if(teamplay)
{
- if(activator.team)
- self.colormap = (activator.team - 1) * 0x11;
+ if(actor.team)
+ this.colormap = (actor.team - 1) * 0x11;
else
- self.colormap = 0x00;
+ this.colormap = 0x00;
}
else
- self.colormap = floor(random() * 256);
- self.colormap |= BIT(10); // RENDER_COLORMAPPED
+ this.colormap = floor(random() * 256);
+ this.colormap |= BIT(10); // RENDER_COLORMAPPED
}
-void g_clientmodel_setcolormaptoactivator ()
-{SELFPARAM();
- g_model_setcolormaptoactivator();
- self.SendFlags |= (BIT(3) | BIT(0));
+void g_clientmodel_setcolormaptoactivator(entity this, entity actor, entity trigger)
+{
+ g_model_setcolormaptoactivator(this, actor, trigger);
+ this.SendFlags |= (BIT(3) | BIT(0));
}
-void g_clientmodel_use()
-{SELFPARAM();
- if (self.antiwall_flag == 1)
+void g_clientmodel_use(entity this, entity actor, entity trigger)
+{
+ if (this.antiwall_flag == 1)
{
- self.inactive = 1;
- self.solid = SOLID_NOT;
+ this.inactive = 1;
+ this.solid = SOLID_NOT;
}
- else if (self.antiwall_flag == 2)
+ else if (this.antiwall_flag == 2)
{
- self.inactive = 0;
- self.solid = self.default_solid;
+ this.inactive = 0;
+ this.solid = this.default_solid;
}
- g_clientmodel_setcolormaptoactivator();
+ g_clientmodel_setcolormaptoactivator(this, actor, trigger);
}
- void g_model_dropbyspawnflags()
- {SELFPARAM();
+ void g_model_dropbyspawnflags(entity this)
+ {
if((self.spawnflags & 3) == 1) // ALIGN_ORIGIN
{
traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
WITHSELF(it, turret_respawn());
));
}
- assault_roundstart_use(this);
+ void assault_roundstart_use_self()
+ {
+ SELFPARAM();
++ assault_roundstart_use(this, NULL, NULL);
+ }
void assault_wall_think()
{SELFPARAM();
assault_attacker_team = NUM_TEAM_1;
self.classname = "target_assault_roundstart";
- self.use1 = assault_roundstart_use;
- self.reset2 = adaptor_think2use;
- InitializeEntity(self, adaptor_think2use, INITPRIO_FINDTARGET);
- self.use = assault_roundstart_use_self;
++ self.use = assault_roundstart_use;
+ self.reset2 = assault_roundstart_use_self;
- InitializeEntity(self, assault_roundstart_use, INITPRIO_FINDTARGET);
++ InitializeEntity(self, assault_roundstart_use_self, INITPRIO_FINDTARGET);
}
// legacy bot code