From 08872e95e039506cdae619179fcce684575dad46 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 6 Jun 2023 03:36:31 -0500 Subject: [PATCH] Fix func_breakable being destroyed with one shot A use function was added to func_breakable so it can be destroyed when triggered by an entity but it stopped using health when shot. Issue introduced in e0418bd2d422527b03b43dbeb61984d800666943. --- engine/code/game/g_combat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/code/game/g_combat.c b/engine/code/game/g_combat.c index 76a331a0..be91ca8e 100644 --- a/engine/code/game/g_combat.c +++ b/engine/code/game/g_combat.c @@ -935,13 +935,13 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, // shootable doors / buttons don't actually have any health if ( targ->s.eType == ET_MOVER ) { - if ( targ->use && (targ->moverState == MOVER_POS1 - || targ->moverState == ROTATOR_POS1) ) { - targ->use( targ, inflictor, attacker ); - } else if ( targ->use == NULL ) { // entity is a func_breakable + if ( !Q_stricmp( targ->classname, "func_breakable" ) ) { targ->health -= damage; if (targ->health <= 0) Break_Breakable (targ, attacker); + } else if ( targ->use && (targ->moverState == MOVER_POS1 + || targ->moverState == ROTATOR_POS1) ) { + targ->use( targ, inflictor, attacker ); } return; }