Fix for resassigning targets after they are moved to a different group

This commit is contained in:
2026-01-26 16:30:40 -05:00
parent a64f9a3d74
commit 5ef8707122
2 changed files with 6 additions and 0 deletions

View File

@@ -304,6 +304,12 @@ class BotAssignmentManager:
# Reassign targets that timed out
for group_id, enemy_id in to_reassign:
# Verify enemy is still in this group before reassigning
enemy_ids = STATE.groups[group_id].get("enemy", [])
if enemy_id not in enemy_ids:
print(f"Enemy {enemy_id} no longer in group {group_id} - not reassigning")
continue
friendly_ids = STATE.groups[group_id].get("friendly", [])
friendly_id = self.get_next_friendly_in_group(group_id, friendly_ids)
if friendly_id: