[Quest API] Adjust GetCloseMobList calls internally (#3530)

* [Quest API] Adjust GetCloseMobList calls internally

* Tweaks
This commit is contained in:
Chris Miles
2023-08-04 13:05:22 -05:00
committed by GitHub
parent 68b40f0239
commit 8fce86c396
2 changed files with 4 additions and 28 deletions
+2 -13
View File
@@ -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;
}