void button_wait(entity this)
{
this.state = STATE_TOP;
- this.nextthink = this.ltime + this.wait;
- setthink(this, button_return);
+ if(this.wait >= 0)
+ {
+ this.nextthink = this.ltime + this.wait;
+ setthink(this, button_return);
+ }
SUB_UseTargets(this, this.enemy, NULL);
this.frame = 1; // use alternate textures
}
setorigin(this, this.pos1);
this.frame = 0; // use normal textures
this.state = STATE_BOTTOM;
+ this.velocity = '0 0 0';
+ setthink(this, func_null);
+ this.nextthink = 0;
if (this.health)
this.takedamage = DAMAGE_YES; // can be shot again
}
if(this.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
return;
- this.health = this.health - damage;
- if (this.health <= 0)
+ if (this.spawnflags & BUTTON_DONTACCUMULATEDMG)
+ {
+ if (this.health <= damage)
+ {
+ this.enemy = attacker;
+ button_fire(this);
+ }
+ }
+ else
{
- this.enemy = damage_attacker;
- button_fire(this);
+ this.health = this.health - damage;
+ if (this.health <= 0)
+ {
+ this.enemy = attacker;
+ button_fire(this);
+ }
}
}
this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
this.flags |= FL_NOTARGET;
+ this.reset = button_reset;
+
button_reset(this);
}
#endif