mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Quest API] Adjust GetCloseMobList calls internally (#3530)
* [Quest API] Adjust GetCloseMobList calls internally * Tweaks
This commit is contained in:
@@ -641,9 +641,7 @@ Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob) {
|
||||
Lua_Mob_List ret;
|
||||
|
||||
const auto& l = self->GetCloseMobList(mob);
|
||||
|
||||
ret.entries.reserve(l.size());
|
||||
|
||||
for (const auto& e : l) {
|
||||
ret.entries.emplace_back(Lua_Mob(e.second));
|
||||
}
|
||||
@@ -653,14 +651,9 @@ Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob) {
|
||||
|
||||
Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob, float distance) {
|
||||
Lua_Safe_Call_Class(Lua_Mob_List);
|
||||
|
||||
Lua_Mob_List ret;
|
||||
|
||||
const auto& l = self->GetCloseMobList(mob);
|
||||
|
||||
ret.entries.reserve(l.size());
|
||||
|
||||
for (const auto& e : l) {
|
||||
for (const auto& e : self->GetCloseMobList(mob)) {
|
||||
if (mob.CalculateDistance(e.second) <= distance) {
|
||||
ret.entries.emplace_back(Lua_Mob(e.second));
|
||||
}
|
||||
@@ -674,11 +667,7 @@ Lua_Mob_List Lua_EntityList::GetCloseMobList(Lua_Mob mob, float distance, bool i
|
||||
|
||||
Lua_Mob_List ret;
|
||||
|
||||
const auto& l = self->GetCloseMobList(mob);
|
||||
|
||||
ret.entries.reserve(l.size());
|
||||
|
||||
for (const auto& e : l) {
|
||||
for (const auto& e : self->GetCloseMobList(mob)) {
|
||||
if (ignore_self && e.second == mob) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user