.float target_spawn_id;
float target_spawn_count;
-void target_spawn_helper_setmodel()
-{SELFPARAM();
- _setmodel(self, self.model);
+void target_spawn_helper_setmodel(entity this)
+{
+ _setmodel(this, this.model);
}
-void target_spawn_helper_setsize()
-{SELFPARAM();
- setsize(self, self.mins, self.maxs);
+void target_spawn_helper_setsize(entity this)
+{
+ setsize(this, this.mins, this.maxs);
}
void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, entity t2, entity t3, entity t4, entity act, entity trigger)
if(time < act.pushltime)
valueent = act.pusher;
else
- valueent = world;
+ valueent = NULL;
value = "";
}
else if(value == "target")
}
else if(value == "time")
{
- valueent = world;
+ valueent = NULL;
value = ftos(time);
}
else
value = strcat("target_spawn_helper", value);
putentityfieldstring(target_spawn_spawnfunc_field, e, value);
- WITHSELF(e, e.target_spawn_spawnfunc(e));
+ e.target_spawn_spawnfunc(e);
// We called an external function, so we have to re-tokenize msg.
n = tokenize_console(msg);
this,
e,
this.message,
- find(world, targetname, this.killtarget),
- find(world, targetname, this.target2),
- find(world, targetname, this.target3),
- find(world, targetname, this.target4),
+ find(NULL, targetname, this.killtarget),
+ find(NULL, targetname, this.target2),
+ find(NULL, targetname, this.target3),
+ find(NULL, targetname, this.target4),
actor,
trigger
);
return true;
++c; // increase count to not include MYSELF
- for(e = world; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c)
+ for(e = NULL; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c)
;
// if c now is 0, we have AT LEAST the given count (maybe more), so don't spawn any more
else
{
// edit entity
- for(entity e = world; (e = find(e, targetname, this.target)); )
- target_spawn_useon(e, this, actor, trigger);
+ FOREACH_ENTITY_STRING(targetname, this.target,
+ {
+ target_spawn_useon(it, this, actor, trigger);
+ });
}
}
spawnfunc(target_spawn)
{
initialize_field_db();
- self.use = target_spawn_use;
- self.message = strzone(strreplace("'", "\"", self.message));
- self.target_spawn_id = ++target_spawn_count;
- InitializeEntity(self, target_spawn_spawnfirst, INITPRIO_LAST);
+ this.use = target_spawn_use;
+ this.message = strzone(strreplace("'", "\"", this.message));
+ this.target_spawn_id = ++target_spawn_count;
+ InitializeEntity(this, target_spawn_spawnfirst, INITPRIO_LAST);
}
#endif