mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Shared Tasks] Task Kill Update Fix (#1573)
* Revert "Revert "Shared task kill update fix""
This reverts commit 859751f74d.
* Swap return for continue in this context
* Slight tweak
* Slight tweak
* Remove no longer needed task methods
* Update scope for IncrementDoneCount
* Create helper method Client::GetPartyMembers() and add client->HasTaskState()
* Move HandleUpdateTasksOnKill responsibility to TaskManager
* Remove unnecessary pointer
This commit is contained in:
@@ -10529,3 +10529,41 @@ void Client::SetDoorToolEntityId(uint16 door_tool_entity_id)
|
||||
{
|
||||
Client::m_door_tool_entity_id = door_tool_entity_id;
|
||||
}
|
||||
|
||||
// this will fetch raid clients if exists
|
||||
// fallback to group if raid doesn't exist
|
||||
// fallback to self if group doesn't exist
|
||||
std::vector<Client *> Client::GetPartyMembers()
|
||||
{
|
||||
// get clients to update
|
||||
std::vector<Client *> clients_to_update = {};
|
||||
|
||||
// raid
|
||||
Raid *raid = entity_list.GetRaidByClient(this);
|
||||
if (raid) {
|
||||
for (auto &e : raid->members) {
|
||||
if (e.member && e.member->IsClient()) {
|
||||
clients_to_update.push_back(e.member->CastToClient());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// group
|
||||
if (clients_to_update.empty()) {
|
||||
Group *group = entity_list.GetGroupByClient(this);
|
||||
if (group) {
|
||||
for (auto &m : group->members) {
|
||||
if (m && m->IsClient()) {
|
||||
clients_to_update.push_back(m->CastToClient());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// solo
|
||||
if (clients_to_update.empty()) {
|
||||
clients_to_update.push_back(this);
|
||||
}
|
||||
|
||||
return clients_to_update;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user