[Tasks] Support Raw NPC Names in Task Goal List (#2333)

This commit is contained in:
hg 2022-07-30 14:33:53 -04:00 committed by GitHub
parent 2ccf692167
commit 6e2d11a283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -2457,7 +2457,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
give_exp_client->GetCleanName(), give_exp_client->GetCleanName(),
GetNPCTypeID() GetNPCTypeID()
); );
task_manager->HandleUpdateTasksOnKill(give_exp_client, GetNPCTypeID(), GetCleanName()); task_manager->HandleUpdateTasksOnKill(give_exp_client, GetNPCTypeID(), this);
} }
if (kr) { if (kr) {

View File

@ -1831,7 +1831,7 @@ void TaskManager::SyncClientSharedTaskStateToLocal(
} }
} }
void TaskManager::HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, std::string npc_name) void TaskManager::HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, NPC* npc)
{ {
for (auto &c: client->GetPartyMembers()) { for (auto &c: client->GetPartyMembers()) {
if (!c->ClientDataLoaded() || !c->HasTaskState()) { if (!c->ClientDataLoaded() || !c->HasTaskState()) {
@ -1897,7 +1897,10 @@ void TaskManager::HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, st
std::to_string(npc_type_id) std::to_string(npc_type_id)
) && !TaskGoalListManager::IsInMatchListPartial( ) && !TaskGoalListManager::IsInMatchListPartial(
activity_info->goal_match_list, activity_info->goal_match_list,
npc_name npc->GetCleanName()
) && !TaskGoalListManager::IsInMatchListPartial(
activity_info->goal_match_list,
npc->GetName()
)) { )) {
LogTasksDetail("[HandleUpdateTasksOnKill] Matched list goal"); LogTasksDetail("[HandleUpdateTasksOnKill] Matched list goal");
continue; continue;

View File

@ -73,7 +73,7 @@ public:
// shared tasks // shared tasks
void SyncClientSharedTaskState(Client *c, ClientTaskState *cts); void SyncClientSharedTaskState(Client *c, ClientTaskState *cts);
void HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, std::string npc_name); void HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, NPC* npc);
private: private:
TaskGoalListManager m_goal_list_manager; TaskGoalListManager m_goal_list_manager;