mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Skip tab-targeting empty looted corpses
Dead creatures with no remaining loot items are now excluded from tab-targeting cycle. Prevents cycling through empty corpses when looking for targetable enemies. Corpses with available loot remain targetable.
This commit is contained in:
parent
bfeb978eff
commit
4d0eef1f6f
1 changed files with 13 additions and 1 deletions
|
|
@ -10595,7 +10595,19 @@ void GameHandler::tabTarget(float playerX, float playerY, float playerZ) {
|
||||||
const uint64_t guid = e->getGuid();
|
const uint64_t guid = e->getGuid();
|
||||||
auto* unit = dynamic_cast<Unit*>(e.get());
|
auto* unit = dynamic_cast<Unit*>(e.get());
|
||||||
if (!unit) return false; // Not a unit (shouldn't happen after type filter)
|
if (!unit) return false; // Not a unit (shouldn't happen after type filter)
|
||||||
if (unit->getHealth() == 0) return false; // Dead / corpse
|
if (unit->getHealth() == 0) {
|
||||||
|
// Dead corpse: only targetable if it has loot or is skinnableable
|
||||||
|
// If corpse was looted and is now empty, skip it (except for skinning)
|
||||||
|
auto lootIt = localLootState_.find(guid);
|
||||||
|
if (lootIt == localLootState_.end() || lootIt->second.data.items.empty()) {
|
||||||
|
// No loot data or all items taken; check if skinnableable
|
||||||
|
// For now, skip empty looted corpses (proper skinning check requires
|
||||||
|
// creature type data that may not be immediately available)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Has unlooted items available
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const bool hostileByFaction = unit->isHostile();
|
const bool hostileByFaction = unit->isHostile();
|
||||||
const bool hostileByCombat = isAggressiveTowardPlayer(guid);
|
const bool hostileByCombat = isAggressiveTowardPlayer(guid);
|
||||||
if (!hostileByFaction && !hostileByCombat) return false;
|
if (!hostileByFaction && !hostileByCombat) return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue