Skip to content

Commit c085f87

Browse files
committed
clean up condition
1 parent 447119e commit c085f87

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

code/weapon/swarm.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void turret_swarm_delete(int i)
312312
void turret_swarm_set_up_info(int parent_objnum, ship_subsys *turret, const weapon_info *wip, int weapon_num, bool no_tracking_object)
313313
{
314314
turret_swarm_info *tsi;
315-
object *parent_obj, *target_obj;
315+
object *parent_obj;
316316
ship *shipp;
317317
int tsi_index;
318318

@@ -334,9 +334,10 @@ void turret_swarm_set_up_info(int parent_objnum, ship_subsys *turret, const weap
334334
Assert(parent_obj->type == OBJ_SHIP);
335335
shipp = &Ships[parent_obj->instance];
336336
Assert(turret->turret_enemy_objnum < MAX_OBJECTS);
337-
if(!no_tracking_object && ((turret->turret_enemy_objnum < 0) || (turret->turret_enemy_objnum >= MAX_OBJECTS))){
337+
if (turret->turret_enemy_objnum < 0 && !no_tracking_object)
338+
return;
339+
if (turret->turret_enemy_objnum >= MAX_OBJECTS)
338340
return;
339-
}
340341

341342
// valid swarm weapon
342343
Assert(((wip->wi_flags[Weapon::Info_Flags::Swarm]) && (wip->swarm_count > 0)) || ((wip->wi_flags[Weapon::Info_Flags::Corkscrew]) && (wip->cs_num_fired > 0)));

0 commit comments

Comments
 (0)