diff options
Diffstat (limited to 'src/map/mob.cpp')
-rw-r--r-- | src/map/mob.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 79a21ea..709df2b 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2094,17 +2094,14 @@ void mob_ai_hard(TimerData *, tick_t tick) *------------------------------------------ */ static -void mob_ai_sub_lazy(db_key_t, db_val_t data, tick_t tick) +void mob_ai_sub_lazy(struct block_list *bl, tick_t tick) { - struct mob_data *md = (struct mob_data *)data; - - nullpo_retv(md); + nullpo_retv(bl); - if (md == NULL) + if (bl->type != BL::MOB) return; - if (md->bl.type == BL::NUL || md->bl.type != BL::MOB) - return; + struct mob_data *md = (struct mob_data *)bl; if (tick < md->last_thinktime + MIN_MOBTHINKTIME * 10) return; @@ -2161,7 +2158,8 @@ void mob_ai_sub_lazy(db_key_t, db_val_t data, tick_t tick) static void mob_ai_lazy(TimerData *, tick_t tick) { - map_foreachiddb(std::bind(mob_ai_sub_lazy, ph::_1, ph::_2, tick)); + for (auto& pair : id_db) + mob_ai_sub_lazy(pair.second, tick); } /*========================================== |