317{
319 return;
320
323 if (iter->source() == nullptr)
324 continue;
325
326 std::shared_ptr<Unit> e = iter->source()->shared_from_this();
327 std::shared_ptr<Monster> m =
_monster.lock();
328
329 if (m == nullptr || e == nullptr)
330 continue;
331
332 if (m->monster_config()->mode &
MONSTER_MODE_MASK_TARGETWEAK && e->status()->base_level()->get_base() >= m->monster_config()->level - 5)
333 return;
334
335#ifdef ACTIVE_PATH_SEARCH
336
337
338
339
340
341
342
344
345 if (wp.size() == 0)
346 continue;
347
348
349 if ((m->is_walking() == false && wp.size() > m->monster_config()->view_range)
350 || (m->is_walking() == true && wp.size() > m->monster_config()->chase_range))
351 continue;
352#endif
353 m->set_target(e);
354
355 break;
356 }
357}
@ MONSTER_MODE_MASK_TARGETWEAK
Definition: MonsterDefinitions.hpp:105
Forward declaration of GridRefManager, the class that manages GridReference.
Definition: GridRefManager.hpp:41
iterator begin()
Definition: GridRefManager.hpp:54
std::vector< MapCoords > CoordinateList
We use a vector because the AStar algorithm is only searching on small datasets. Other data structure...
Definition: AStar.hpp:77
Definition: NPCDefinitions.hpp:54