+#include "door_rotating.qh"
#ifdef SVQC
/*QUAKED spawnfunc_func_door_rotating (0 .5 .8) ? START_OPEN BIDIR DOOR_DONT_LINK BIDIR_IN_DOWN x TOGGLE X_AXIS Y_AXIS
if two doors touch, they are assumed to be connected and operate as a unit.
FIXME: only one sound set available at the time being
*/
-void door_rotating_reset()
-{SELFPARAM();
- self.angles = self.pos1;
- self.avelocity = '0 0 0';
- self.state = STATE_BOTTOM;
- self.think = func_null;
- self.nextthink = 0;
+void door_rotating_reset(entity this)
+{
+ this.angles = this.pos1;
+ this.avelocity = '0 0 0';
+ this.state = STATE_BOTTOM;
+ setthink(this, func_null);
+ this.nextthink = 0;
}
-void door_rotating_init_startopen()
-{SELFPARAM();
- self.angles = self.movedir;
- self.pos2 = '0 0 0';
- self.pos1 = self.movedir;
+void door_rotating_init_startopen(entity this)
+{
+ this.angles = this.movedir;
+ this.pos2 = '0 0 0';
+ this.pos1 = this.movedir;
}
spawnfunc(func_door_rotating)
{
- //if (!self.deathtype) // map makers can override this
- // self.deathtype = " got in the way";
+ //if (!this.deathtype) // map makers can override this
+ // this.deathtype = " got in the way";
// I abuse "movedir" for denoting the axis for now
- if (self.spawnflags & 64) // X (untested)
- self.movedir = '0 0 1';
- else if (self.spawnflags & 128) // Y (untested)
- self.movedir = '1 0 0';
+ if (this.spawnflags & 64) // X (untested)
+ this.movedir = '0 0 1';
+ else if (this.spawnflags & 128) // Y (untested)
+ this.movedir = '1 0 0';
else // Z
- self.movedir = '0 1 0';
+ this.movedir = '0 1 0';
- if (self.angles_y==0) self.angles_y = 90;
+ if (this.angles_y==0) this.angles_y = 90;
- self.movedir = self.movedir * self.angles_y;
- self.angles = '0 0 0';
+ this.movedir = this.movedir * this.angles_y;
+ this.angles = '0 0 0';
- self.max_health = self.health;
- self.avelocity = self.movedir;
- if (!InitMovingBrushTrigger())
+ this.max_health = this.health;
+ this.avelocity = this.movedir;
+ if (!InitMovingBrushTrigger(this))
return;
- self.velocity = '0 0 0';
- //self.effects |= EF_LOWPRECISION;
- self.classname = "door_rotating";
+ this.velocity = '0 0 0';
+ //this.effects |= EF_LOWPRECISION;
+ this.classname = "door_rotating";
- self.blocked = door_blocked;
- self.use = door_use;
+ setblocked(this, door_blocked);
+ this.use = door_use;
- if(self.spawnflags & 8)
- self.dmg = 10000;
+ if(this.spawnflags & 8)
+ this.dmg = 10000;
- if(self.dmg && (self.message == ""))
- self.message = "was squished";
- if(self.dmg && (self.message2 == ""))
- self.message2 = "was squished by";
+ if(this.dmg && (this.message == ""))
+ this.message = "was squished";
+ if(this.dmg && (this.message2 == ""))
+ this.message2 = "was squished by";
- if (self.sounds > 0)
+ if (this.sounds > 0)
{
precache_sound ("plats/medplat1.wav");
precache_sound ("plats/medplat2.wav");
- self.noise2 = "plats/medplat1.wav";
- self.noise1 = "plats/medplat2.wav";
+ this.noise2 = "plats/medplat1.wav";
+ this.noise1 = "plats/medplat2.wav";
}
- if (!self.speed)
- self.speed = 50;
- if (!self.wait)
- self.wait = 1;
- self.lip = 0; // self.lip is used to remember reverse opening direction for door_rotating
+ if (!this.speed)
+ this.speed = 50;
+ if (!this.wait)
+ this.wait = 1;
+ this.lip = 0; // this.lip is used to remember reverse opening direction for door_rotating
- self.pos1 = '0 0 0';
- self.pos2 = self.movedir;
+ this.pos1 = '0 0 0';
+ this.pos2 = this.movedir;
// DOOR_START_OPEN is to allow an entity to be lighted in the closed position
// but spawn in the open position
- if (self.spawnflags & DOOR_START_OPEN)
- InitializeEntity(self, door_rotating_init_startopen, INITPRIO_SETLOCATION);
+ if (this.spawnflags & DOOR_START_OPEN)
+ InitializeEntity(this, door_rotating_init_startopen, INITPRIO_SETLOCATION);
- self.state = STATE_BOTTOM;
+ this.state = STATE_BOTTOM;
- if (self.health)
+ if (this.health)
{
- self.takedamage = DAMAGE_YES;
- self.event_damage = door_damage;
+ this.takedamage = DAMAGE_YES;
+ this.event_damage = door_damage;
}
- if (self.items)
- self.wait = -1;
+ if (this.items)
+ this.wait = -1;
- self.touch = door_touch;
+ settouch(this, door_touch);
// LinkDoors can't be done until all of the doors have been spawned, so
// the sizes can be detected properly.
- InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
+ InitializeEntity(this, LinkDoors, INITPRIO_LINKDOORS);
- self.reset = door_rotating_reset;
+ this.reset = door_rotating_reset;
}
#endif