#ifdef SVQC
&& (other.takedamage != DAMAGE_NO)
#elif defined(CSQC)
- && !PHYS_DEAD(other)
+ && !IS_DEAD(other)
#endif
)
{ // KIll Kill Kill!!
#endif
// don't change direction for dead or dying stuff
- if(PHYS_DEAD(other)
+ if(IS_DEAD(other)
#ifdef SVQC
&& (other.takedamage == DAMAGE_NO)
#endif
string oldmessage;
oldmessage = self.message;
self.message = "";
- SUB_UseTargets();
+ SUB_UseTargets(self, NULL, NULL);
self.message = oldmessage;
}
return false;
}
-void door_fire()
-{SELFPARAM();
- entity starte;
-
- if (self.owner != self)
- objerror ("door_fire: self.owner != self");
+void door_fire(entity this, entity actor, entity trigger)
+{
+ entity starte;
+ if (this.owner != this)
+ objerror ("door_fire: this.owner != this");
- if (self.spawnflags & DOOR_TOGGLE)
+ if (this.spawnflags & DOOR_TOGGLE)
{
- if (self.state == STATE_UP || self.state == STATE_TOP)
+ if (this.state == STATE_UP || this.state == STATE_TOP)
{
starte = self;
do
setself(this);
}
-void door_use()
-{SELFPARAM();
+void door_use(entity this, entity actor, entity trigger)
+{
//dprint("door_use (model: ");dprint(self.model);dprint(")\n");
- if (self.owner)
- {
- WITH(entity, self, self.owner, door_fire());
- }
+ if (this.owner)
+ WITHSELF(this.owner, door_fire(this.owner, actor, trigger));
}
-void door_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
- if(self.spawnflags & DOOR_NOSPLASH)
+void door_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+ if(this.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
- self.health = self.health - damage;
+ this.health = this.health - damage;
- if (self.itemkeys)
+ if (this.itemkeys)
{
// don't allow opening doors through damage if keys are required
return;
}
- if (self.health <= 0)
+ if (this.health <= 0)
{
- self.owner.health = self.owner.max_health;
- self.owner.takedamage = DAMAGE_NO; // wil be reset upon return
- WITH(entity, self, self.owner, door_use());
+ this.owner.health = this.owner.max_health;
+ this.owner.takedamage = DAMAGE_NO; // wil be reset upon return
+ door_use(this.owner, NULL, NULL);
}
}
#endif
//Dont chamge direction for dead or dying stuff
- if(PHYS_DEAD(other) && (other.takedamage == DAMAGE_NO))
+ if(IS_DEAD(other) && (other.takedamage == DAMAGE_NO))
{
if (self.wait >= 0)
{
string oldmessage;
oldmessage = self.message;
self.message = "";
- SUB_UseTargets();
+ SUB_UseTargets(self, NULL, other); // TODO: is other needed here?
self.message = oldmessage;
}
{SELFPARAM();
if (other.health < 1)
#ifdef SVQC
- if (!((other.iscreature || (other.flags & FL_PROJECTILE)) && !PHYS_DEAD(other)))
+ if (!((other.iscreature || (other.flags & FL_PROJECTILE)) && !IS_DEAD(other)))
#elif defined(CSQC)
- if(!((IS_CLIENT(other) || other.classname == "csqcprojectile") && !PHYS_DEAD(other)))
+ if(!((IS_CLIENT(other) || other.classname == "csqcprojectile") && !IS_DEAD(other)))
#endif
return;
self.door_finished = time + 1;
- activator = other;
-
- setself(self.owner);
- door_use ();
+ door_use(this.owner, other, NULL);
}
void door_spawnfield(vector fmins, vector fmaxs)
#ifdef SVQC
void door_link();
#endif
-void LinkDoors()
-{SELFPARAM();
+void LinkDoors(entity this)
+{
entity t;
vector cmins, cmaxs;
WriteString(MSG_ENTITY, self.model);
- trigger_common_write(true);
+ trigger_common_write(self, true);
WriteCoord(MSG_ENTITY, self.pos1_x);
WriteCoord(MSG_ENTITY, self.pos1_y);
}
#endif
-void door_init_startopen()
-{SELFPARAM();
+void door_init_startopen(entity this)
+{
SUB_SETORIGIN(self, self.pos2);
self.pos2 = self.pos1;
self.pos1 = self.origin;
this.drawmask = MASK_NORMAL;
this.use = door_use;
- LinkDoors();
+ LinkDoors(this);
if(this.spawnflags & DOOR_START_OPEN)
- door_init_startopen();
+ door_init_startopen(this);
this.move_time = time;
this.move_origin = this.origin;