*/
void door_go_down(entity this);
-void() door_go_up;
+void door_go_up(entity this);
void door_rotating_go_down(entity this);
-void() door_rotating_go_up;
+void door_rotating_go_up(entity this);
void door_blocked()
{SELFPARAM();
if (self.state == STATE_DOWN)
if (self.classname == "door")
{
- door_go_up ();
+ door_go_up (self);
} else
{
- door_rotating_go_up ();
+ door_rotating_go_up (self);
}
else
if (self.classname == "door")
}
self.state = STATE_DOWN;
- SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
+ SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_hit_bottom);
}
-void door_go_up()
-{SELFPARAM();
+void door_go_up(entity this)
+{
if (self.state == STATE_UP)
return; // already going up
if (self.noise2 != "")
_sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
- SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
+ SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_hit_top);
string oldmessage;
oldmessage = self.message;
entity e = this;
do {
if (e.classname == "door") {
- WITHSELF(e, door_go_up());
+ WITHSELF(e, door_go_up(e));
} else {
// if the BIDIR spawnflag (==2) is set and the trigger has set trigger_reverse, reverse the opening direction
if ((e.spawnflags & 2) && other.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
if (!((e.spawnflags & 2) && (e.spawnflags & 8) && e.state == STATE_DOWN
&& (((e.lip == 666) && (other.trigger_reverse == 0)) || ((e.lip != 666) && (other.trigger_reverse != 0)))))
{
- WITHSELF(e, door_rotating_go_up());
+ WITHSELF(e, door_rotating_go_up(e));
}
}
e = e.enemy;
#endif
}
-void door_generic_plat_blocked()
-{SELFPARAM();
+void door_generic_plat_blocked(entity this)
+{
if((self.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
#ifdef SVQC
if (self.wait >= 0)
{
if (self.state == STATE_DOWN)
- door_rotating_go_up ();
+ door_rotating_go_up (self);
else
door_rotating_go_down (self);
}
}
self.state = STATE_DOWN;
- SUB_CalcAngleMove (self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
+ SUB_CalcAngleMove (self, self.pos1, TSPEED_LINEAR, self.speed, door_rotating_hit_bottom);
}
-void door_rotating_go_up()
-{SELFPARAM();
+void door_rotating_go_up(entity this)
+{
if (self.state == STATE_UP)
return; // already going up
if (self.noise2 != "")
_sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
self.state = STATE_UP;
- SUB_CalcAngleMove (self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
+ SUB_CalcAngleMove (self, self.pos2, TSPEED_LINEAR, self.speed, door_rotating_hit_top);
string oldmessage;
oldmessage = self.message;
door_use(this.owner, other, NULL);
}
-void door_spawnfield(vector fmins, vector fmaxs)
-{SELFPARAM();
+void door_spawnfield(entity this, vector fmins, vector fmaxs)
+{
entity trigger;
vector t1 = fmins, t2 = fmaxs;
*/
entity LinkDoors_nextent(entity cur, entity near, entity pass)
-{SELFPARAM();
- while((cur = find(cur, classname, self.classname)) && ((cur.spawnflags & 4) || cur.enemy))
+{
+ while((cur = find(cur, classname, pass.classname)) && ((cur.spawnflags & 4) || cur.enemy))
{
}
return cur;
if (self.items)
return;
- door_spawnfield(self.absmin, self.absmax);
+ door_spawnfield(self, self.absmin, self.absmax);
return; // don't want to link this door
}
- FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, world);
+ FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, self);
// set owner, and make a loop of the chain
LOG_TRACE("LinkDoors: linking doors:");
if (self.items)
return;
- door_spawnfield(cmins, cmaxs);
+ door_spawnfield(self, cmins, cmaxs);
}
REGISTER_NET_LINKED(ENT_CLIENT_DOOR)
*/
-float door_send(entity to, float sf)
-{SELFPARAM();
+float door_send(entity this, entity to, float sf)
+{
WriteHeader(MSG_ENTITY, ENT_CLIENT_DOOR);
WriteByte(MSG_ENTITY, sf);