Skip to content

Commit 19cc636

Browse files
caldazar-atmjstahlberg
authored andcommitted
Fix hive sometimes attacking while OM is down.
When being attacked, hives fire once without checking if there was an OM. Also, if there is no OM, hives ignore the timeout of their swarm. This patch fixes both problems. Signed-off-by: Viech <viech@unvanquished.net>
1 parent c075814 commit 19cc636

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gamelogic/game/g_buildable.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,17 +1574,17 @@ void AHive_Think( gentity_t *self )
15741574

15751575
AGeneric_Think( self );
15761576

1577-
if ( !self->spawned || !self->powered || self->health <= 0 )
1578-
{
1579-
return;
1580-
}
1581-
15821577
// last missile hasn't returned in time, forget about it
15831578
if ( self->timestamp < level.time )
15841579
{
15851580
self->active = qfalse;
15861581
}
15871582

1583+
if ( !self->spawned || !self->powered || self->health <= 0 )
1584+
{
1585+
return;
1586+
}
1587+
15881588
if ( self->active )
15891589
{
15901590
return;
@@ -1602,7 +1602,7 @@ void AHive_Pain( gentity_t *self, gentity_t *attacker, int damage )
16021602
AGeneric_Pain( self, attacker, damage );
16031603

16041604
// if inactive, fire on attacker even if it's out of sense range
1605-
if ( self->spawned && self->health > 0 && !self->active )
1605+
if ( self->spawned && self->powered && self->health > 0 && !self->active )
16061606
{
16071607
if ( AHive_TargetValid( self, attacker, qtrue ) )
16081608
{

0 commit comments

Comments
 (0)