diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index cda1b6244d..8c80529d96 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1042,6 +1042,22 @@ public: } handler->SendSysMessage("End of threatened by me list."); + + // Also show combat refs that may not appear in the threat list + // (e.g. creatures without threat lists like triggers/environmental hazards) + handler->PSendSysMessage("Combat refs (InCombat: {} | HasCombat: {})", target->IsInCombat(), target->GetCombatManager().HasCombat()); + for (auto const& ref : target->GetCombatManager().GetPvECombatRefs()) + { + Unit* unit = ref.second->GetOther(target); + handler->PSendSysMessage(" [PvE] {} ({}) Entry: {}", unit->GetName(), unit->GetGUID().ToString(), + unit->IsCreature() ? unit->ToCreature()->GetEntry() : 0); + } + for (auto const& ref : target->GetCombatManager().GetPvPCombatRefs()) + { + Unit* unit = ref.second->GetOther(target); + handler->PSendSysMessage(" [PvP] {} ({})", unit->GetName(), unit->GetGUID().ToString()); + } + return true; }