Skip to content

Commit

Permalink
Fix error with Projectiles in the squaddies array in PirateShip
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanLovato committed Mar 5, 2020
1 parent d16bd62 commit ff0a553
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions project/src/Ships/Enemies/Pirate/PirateShip.gd
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func _die() -> void:
emit_signal("died")
var new_leader: KinematicBody2D
for squaddie in squaddies:
# FIXME: I had an error because a Projectile was in the squaddies array
# We should ensure this cannot happen, and squaddies are all from the faction
if not squaddie.is_in_group("Enemies"):
continue
if squaddie._health > 0:
new_leader = squaddie
break
Expand Down

0 comments on commit ff0a553

Please sign in to comment.