fix: targetEnemy uses faction isHostile() instead of targeting all non-player units

This commit is contained in:
Kelsi 2026-03-13 11:37:13 -07:00
parent 84d5a1125f
commit 04768f41de

View file

@ -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<Unit>(entity);
if (unit && guid != playerGuid) {
if (unit && guid != playerGuid && unit->isHostile()) {
hostiles.push_back(guid);
}
}