From 04768f41de40b3fc5dd8abaf72999710154ea4d8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 11:37:13 -0700 Subject: [PATCH] fix: targetEnemy uses faction isHostile() instead of targeting all non-player units --- src/game/game_handler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 27afba4a..62535583 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -11699,9 +11699,8 @@ void GameHandler::targetEnemy(bool reverse) { for (const auto& [guid, entity] : entities) { if (entity->getType() == ObjectType::UNIT) { - // Check if hostile (this is simplified - would need faction checking) auto unit = std::dynamic_pointer_cast(entity); - if (unit && guid != playerGuid) { + if (unit && guid != playerGuid && unit->isHostile()) { hostiles.push_back(guid); } }