string key, value, valuefield, valueoffset, valueoffsetrandom;
entity valueent;
vector data, data2;
- entity oldactivator;
n = tokenize_console(msg);
value = strcat("target_spawn_helper", value);
putentityfieldstring(target_spawn_spawnfunc_field, e, value);
- oldactivator = activator;
-
- activator = act;
WITHSELF(e, e.target_spawn_spawnfunc(e));
- activator = oldactivator;
// We called an external function, so we have to re-tokenize msg.
n = tokenize_console(msg);
else if(this.target == "*activator")
{
// edit entity
- if(activator)
+ if(actor)
target_spawn_useon(actor, this, actor, trigger);
}
else
/**
* trigger given targets
*/
-void trigger_keylock_trigger(string s)
-{SELFPARAM();
+void trigger_keylock_trigger(entity this, entity actor, string s)
+{
for(entity t = world; (t = find(t, targetname, s)); )
if(t.use1)
- t.use1(t, NULL, this);
+ t.use1(t, actor, this);
}
/**
if(self.itemkeys)
key_used = item_keys_usekey(self, other);
- activator = other;
-
if(self.itemkeys)
{
#ifdef SVQC
if(self.delay <= time || started_delay == true)
if(self.target2)
{
- trigger_keylock_trigger(self.target2);
+ trigger_keylock_trigger(this, other, self.target2);
started_delay = true;
self.delay = time + self.wait;
}
#endif
if(self.target)
- trigger_keylock_trigger(self.target);
+ trigger_keylock_trigger(this, other, self.target);
if(self.killtarget)
trigger_keylock_kill(self.killtarget);