Skip to content

Commit ff0a553

Browse files
committed
Fix error with Projectiles in the squaddies array in PirateShip
1 parent d16bd62 commit ff0a553

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

project/src/Ships/Enemies/Pirate/PirateShip.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ func _die() -> void:
120120
emit_signal("died")
121121
var new_leader: KinematicBody2D
122122
for squaddie in squaddies:
123+
# FIXME: I had an error because a Projectile was in the squaddies array
124+
# We should ensure this cannot happen, and squaddies are all from the faction
125+
if not squaddie.is_in_group("Enemies"):
126+
continue
123127
if squaddie._health > 0:
124128
new_leader = squaddie
125129
break

0 commit comments

Comments
 (0)