mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-11-24 21:01:34 +00:00
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 e0418bd2d4
.
This commit is contained in:
parent
ed6fbd1796
commit
08872e95e0
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue