mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
fix: targetEnemy uses faction isHostile() instead of targeting all non-player units
This commit is contained in:
parent
84d5a1125f
commit
04768f41de
1 changed files with 1 additions and 2 deletions
|
|
@ -11699,9 +11699,8 @@ void GameHandler::targetEnemy(bool reverse) {
|
||||||
|
|
||||||
for (const auto& [guid, entity] : entities) {
|
for (const auto& [guid, entity] : entities) {
|
||||||
if (entity->getType() == ObjectType::UNIT) {
|
if (entity->getType() == ObjectType::UNIT) {
|
||||||
// Check if hostile (this is simplified - would need faction checking)
|
|
||||||
auto unit = std::dynamic_pointer_cast<Unit>(entity);
|
auto unit = std::dynamic_pointer_cast<Unit>(entity);
|
||||||
if (unit && guid != playerGuid) {
|
if (unit && guid != playerGuid && unit->isHostile()) {
|
||||||
hostiles.push_back(guid);
|
hostiles.push_back(guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue