mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 10:50:24 +00:00
[Bug Fix] Fix EVENT_KILLED_MERIT firing before NPC removal (#4185)
* [Bug Fix] Fix EVENT_KILLED_MERIT firing before NPC removal # Notes - NPCs were parsing this event too early and anything that checked if they were still alive in `EVENT_KILLED_MERIT` would show them still alive because of this. # Image * Code cleanup * Update client.h * Add GetRaidOrGroupOrSelf() to Perl/Lua * Update to luabind::object, fix logic per comments. * Fix * Fix per comments.
This commit is contained in:
@@ -12320,3 +12320,34 @@ int Client::GetEXPPercentage()
|
||||
|
||||
return static_cast<int>(std::round(scaled * 100.0 / 330.0)); // unscaled pct
|
||||
}
|
||||
|
||||
std::vector<Mob*> Client::GetRaidOrGroupOrSelf(bool clients_only)
|
||||
{
|
||||
std::vector<Mob*> v;
|
||||
|
||||
if (IsRaidGrouped()) {
|
||||
Raid* r = GetRaid();
|
||||
|
||||
if (r) {
|
||||
for (const auto& m : r->members) {
|
||||
if (m.member && (!m.is_bot || !clients_only)) {
|
||||
v.emplace_back(m.member);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (IsGrouped()) {
|
||||
Group* g = GetGroup();
|
||||
|
||||
if (g) {
|
||||
for (const auto& m : g->members) {
|
||||
if (m && (m->IsClient() || !clients_only)) {
|
||||
v.emplace_back(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v.emplace_back(this);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user