/**
* trigger given targets
*/
-void trigger_keylock_trigger(string s)
-{SELFPARAM();
- entity otemp = other;
- entity atemp = activator;
-
- entity t;
- for(t = world; (t = find(t, targetname, s)); )
- if(t.use)
- {
- setself(t);
- other = this;
- activator = atemp;
- self.use();
- }
-
- setself(this);
- other = otemp;
- activator = atemp;
+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, 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);
WriteInt24_t(MSG_ENTITY, self.itemkeys);
WriteByte(MSG_ENTITY, self.height);
- trigger_common_write(true);
+ trigger_common_write(self, true);
return true;
}
trigger_keylock_link();
}
#elif defined(CSQC)
-void keylock_remove()
-{SELFPARAM();
- if(self.target) { strunzone(self.target); }
- self.target = string_null;
+void keylock_remove(entity this)
+{
+ if(this.target) { strunzone(this.target); }
+ this.target = string_null;
- if(self.target2) { strunzone(self.target2); }
- self.target2 = string_null;
+ if(this.target2) { strunzone(this.target2); }
+ this.target2 = string_null;
- if(self.target3) { strunzone(self.target3); }
- self.target3 = string_null;
+ if(this.target3) { strunzone(this.target3); }
+ this.target3 = string_null;
- if(self.target4) { strunzone(self.target4); }
- self.target4 = string_null;
+ if(this.target4) { strunzone(this.target4); }
+ this.target4 = string_null;
- if(self.killtarget) { strunzone(self.killtarget); }
- self.killtarget = string_null;
+ if(this.killtarget) { strunzone(this.killtarget); }
+ this.killtarget = string_null;
- if(self.targetname) { strunzone(self.targetname); }
- self.targetname = string_null;
+ if(this.targetname) { strunzone(this.targetname); }
+ this.targetname = string_null;
}
NET_HANDLE(ENT_CLIENT_KEYLOCK, bool isnew)