Move stage name printing out of enemy loop
@@ -93,7 +93,10 @@ def print_all_enemy_locations(self):
actors = dzx.entries_by_type_and_layer("ACTR", layer)
enemies = [actor for actor in actors if actor.name in all_enemy_actor_names]
- for enemy in enemies:
+ if not enemies:
+ continue
+
+ # Add a comment before the start of each stage (or island) with its name.
if stage_folder != prev_stage_folder or (stage_folder == "sea" and arc_name != prev_arc_name):
if stage_folder == "sea" and arc_name != "Stage.arc":
stage_name = self.island_names[arc_name]
@@ -105,6 +108,8 @@ def print_all_enemy_locations(self):
prev_stage_folder = stage_folder
prev_arc_name = arc_name
+ # Then write each of the individual enemies in the group.
+ for enemy in enemies:
enemy_data = get_enemy_data_for_actor(self, enemy)
enemy_pretty_name = enemy_data["Pretty name"]
