aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-06-23 00:32:13 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-12 00:31:15 +0100
commit35e55f10899712435102764671241b94a2026599 (patch)
tree431aafcba232130d585fd8bebdf3609d770318a7 /src/server/scripts/Commands
parentdd22c6fe67711901587a0a2fe6ed5587dc6d5024 (diff)
Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981.
(cherry picked from commit dbe3bbefe734f8824e8f07c302e256f0d446b974)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index ab1aec347ba..3bba570eb33 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -891,7 +891,7 @@ public:
{
if (!mgr.IsThreatListEmpty(true))
{
- if (mgr.IsEngaged())
+ if (target->IsEngaged())
handler->PSendSysMessage("Threat list of %s (%s, SpawnID " UI64FMTD "):", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
else
handler->PSendSysMessage("%s (%s, SpawnID " UI64FMTD ") is not engaged, but still has a threat list? Well, here it is:", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
@@ -932,13 +932,15 @@ public:
}
handler->SendSysMessage("End of threat list.");
}
- else if (!mgr.IsEngaged())
+ else if (!target->IsEngaged())
handler->PSendSysMessage("%s (%s, SpawnID " UI64FMTD ") is not currently engaged.", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
else
handler->PSendSysMessage("%s (%s, SpawnID " UI64FMTD ") seems to be engaged, but does not have a threat list??", target->GetName().c_str(), target->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
}
+ else if (target->IsEngaged())
+ handler->PSendSysMessage("%s (%s) is currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().ToString().c_str());
else
- handler->PSendSysMessage("%s (%s) cannot have a threat list.", target->GetName().c_str(), target->GetGUID().ToString().c_str());
+ handler->PSendSysMessage("%s (%s) is not currently engaged. (This unit cannot have a threat list.)", target->GetName().c_str(), target->GetGUID().ToString().c_str());
return true;
}