func_button: Fix buttons not being able to be shot more than once.

This commit is contained in:
Marco Cawthorne 2023-04-16 01:00:10 -07:00
parent 6d6e0cc6a6
commit 5c4d693c0e
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 7 additions and 0 deletions

View File

@ -303,6 +303,12 @@ func_button::MoverFinishesMoving(void)
MoveToPosition(GetMoverPosition1(), m_flSpeed);
}
/* let's reset our button's health and mark it as shootable */
SetHealth(GetSpawnHealth());
if (GetHealth() > 0)
SetTakedamage(DAMAGE_YES);
if (GetMoverState() == MOVER_POS1) {
UseOutput(this, m_strOnOut);
SetFrame(FRAME_OFF);
@ -370,6 +376,7 @@ func_button::Trigger(entity act, triggermode_t state)
void
func_button::DeathTrigger(void)
{
SetTakedamage(DAMAGE_NO);
Trigger(g_dmg_eAttacker, TRIG_TOGGLE);
}