* trigger given targets
*/
void trigger_keylock_trigger(string s)
-{
- entity stemp = self;
+{SELFPARAM();
entity otemp = other;
entity atemp = activator;
for(t = world; (t = find(t, targetname, s)); )
if(t.use)
{
- self = t;
- other = stemp;
+ setself(t);
+ other = this;
activator = atemp;
self.use();
}
- self = stemp;
+ setself(this);
other = otemp;
activator = atemp;
}
}
void trigger_keylock_touch()
-{
+{SELFPARAM();
bool key_used = false;
bool started_delay = false;
#ifdef SVQC
bool trigger_keylock_send(entity to, int sf)
-{
+{SELFPARAM();
WriteByte(MSG_ENTITY, ENT_CLIENT_KEYLOCK);
WriteInt24_t(MSG_ENTITY, self.itemkeys);
message2 and noise2 will be resent to the player every 2 seconds while he is in the trigger zone.
*/
void spawnfunc_trigger_keylock(void)
-{
+{SELFPARAM();
if(!self.itemkeys) { remove(self); return; }
// set unlocked message
}
#elif defined(CSQC)
void keylock_remove()
-{
+{SELFPARAM();
if(self.target) { strunzone(self.target); }
self.target = string_null;
}
void ent_keylock()
-{
+{SELFPARAM();
self.itemkeys = ReadInt24_t();
self.height = ReadByte();