*/
void door_go_down(entity this);
-void door_go_up(entity this);
+void door_go_up(entity this, entity actor, entity trigger);
void door_rotating_go_down(entity this);
void door_rotating_go_up(entity this, entity oth);
)
{ // KIll Kill Kill!!
#ifdef SVQC
- Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
#endif
}
else
{
#ifdef SVQC
if((this.dmg) && (blocker.takedamage == DAMAGE_YES)) // Shall we bite?
- Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
#endif
// don't change direction for dead or dying stuff
if (this.state == STATE_DOWN)
if (this.classname == "door")
{
- door_go_up (this);
+ door_go_up (this, NULL, NULL);
} else
{
door_rotating_go_up(this, blocker);
{
//gib dying stuff just to make sure
if((this.dmg) && (blocker.takedamage != DAMAGE_NO)) // Shall we bite?
- Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
}
#endif
}
SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, door_hit_bottom);
}
-void door_go_up(entity this)
+void door_go_up(entity this, entity actor, entity trigger)
{
if (this.state == STATE_UP)
return; // already going up
string oldmessage;
oldmessage = this.message;
this.message = "";
- SUB_UseTargets(this, NULL, NULL);
+ SUB_UseTargets(this, actor, trigger);
this.message = oldmessage;
}
entity e = this;
do {
if (e.classname == "door") {
- door_go_up(e);
+ door_go_up(e, actor, trigger);
} else {
// if the BIDIR spawnflag (==2) is set and the trigger has set trigger_reverse, reverse the opening direction
if ((e.spawnflags & 2) && trigger.trigger_reverse!=0 && e.lip != 666 && e.state == STATE_BOTTOM) {
door_fire(this.owner, actor, trigger);
}
-void door_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+void door_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
if(this.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
{
if((this.spawnflags & 8) && (blocker.takedamage != DAMAGE_NO)) { // Kill Kill Kill!!
#ifdef SVQC
- Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
#endif
}
else
#ifdef SVQC
if((this.dmg) && (blocker.takedamage == DAMAGE_YES)) // Shall we bite?
- Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
#endif
//Dont chamge direction for dead or dying stuff
{
//gib dying stuff just to make sure
if((this.dmg) && (blocker.takedamage != DAMAGE_NO)) // Shall we bite?
- Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, blocker.origin, '0 0 0');
+ Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
}
#endif
}
trigger_common_write(this, true);
- WriteCoord(MSG_ENTITY, this.pos1_x);
- WriteCoord(MSG_ENTITY, this.pos1_y);
- WriteCoord(MSG_ENTITY, this.pos1_z);
- WriteCoord(MSG_ENTITY, this.pos2_x);
- WriteCoord(MSG_ENTITY, this.pos2_y);
- WriteCoord(MSG_ENTITY, this.pos2_z);
+ WriteVector(MSG_ENTITY, this.pos1);
+ WriteVector(MSG_ENTITY, this.pos2);
- WriteCoord(MSG_ENTITY, this.size_x);
- WriteCoord(MSG_ENTITY, this.size_y);
- WriteCoord(MSG_ENTITY, this.size_z);
+ WriteVector(MSG_ENTITY, this.size);
WriteShort(MSG_ENTITY, this.wait);
WriteShort(MSG_ENTITY, this.speed);
if(sf & SF_TRIGGER_UPDATE)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
-
- WriteCoord(MSG_ENTITY, this.pos1_x);
- WriteCoord(MSG_ENTITY, this.pos1_y);
- WriteCoord(MSG_ENTITY, this.pos1_z);
- WriteCoord(MSG_ENTITY, this.pos2_x);
- WriteCoord(MSG_ENTITY, this.pos2_y);
- WriteCoord(MSG_ENTITY, this.pos2_z);
+ WriteVector(MSG_ENTITY, this.origin);
+
+ WriteVector(MSG_ENTITY, this.pos1);
+ WriteVector(MSG_ENTITY, this.pos2);
}
return true;
if (this.health)
{
+ //this.canteamdamage = true; // TODO
this.takedamage = DAMAGE_YES;
this.event_damage = door_damage;
}
trigger_common_read(this, true);
- vector v;
-
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.pos1 = v;
-
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.pos2 = v;
+ this.pos1 = ReadVector();
+ this.pos2 = ReadVector();
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.size = v;
+ this.size = ReadVector();
this.wait = ReadShort();
this.speed = ReadShort();
if(sf & SF_TRIGGER_UPDATE)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
- this.pos1_x = ReadCoord();
- this.pos1_y = ReadCoord();
- this.pos1_z = ReadCoord();
- this.pos2_x = ReadCoord();
- this.pos2_y = ReadCoord();
- this.pos2_z = ReadCoord();
+ this.pos1 = ReadVector();
+ this.pos2 = ReadVector();
}
return true;
}