Sanity check on adding self to other lists

This commit is contained in:
Akkadius 2020-07-19 01:34:25 -05:00
parent fc6689ec09
commit 98340751b0

View File

@ -2657,7 +2657,6 @@ bool EntityList::RemoveMobFromCloseLists(Mob *mob)
auto it = mob_list.begin();
while (it != mob_list.end()) {
LogEntityManagement(
"Removing mob [{}] from [{}] close list entity_id ({})",
mob->GetCleanName(),
@ -2719,7 +2718,7 @@ void EntityList::ScanCloseMobs(
if (distance <= scan_range || mob->GetAggroRange() >= scan_range) {
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
if (add_self_to_other_lists) {
if (add_self_to_other_lists && scanning_mob->GetID() > 0) {
bool has_mob = false;
for (auto &cm: mob->close_mobs) {