From 55544037331569a5431751cb1df9d5576023b338 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Tue, 14 Apr 2020 07:57:04 +0200 Subject: Apply code style to mob_getfriendstatus() --- src/map/mob.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/map/mob.c b/src/map/mob.c index 2f9fc3e99..843eabb8d 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3429,14 +3429,25 @@ static int mob_getfriendstatus_sub(struct block_list *bl, va_list ap) return 0; } +/** + * Gets a random monster/character within a range of 8 cells around md. + * If md is summoned (no monster slave!) a character is picker, otherwise a monster. + * + * @param md The monster which tries to cast a skill. + * @param cond1 Whether to check for active or inactive status change. (MSC_FRIENDSTATUSON/MSC_FRIENDSTATUSOFF) + * @param cond2 The status change (SC_* flag) to check. + * @return A randomly picked monster/character within range. + * + **/ static struct block_list *mob_getfriendstatus(struct mob_data *md, int cond1, int cond2) { - struct block_list *fr = NULL; nullpo_ret(md); int type = (md->special_state.ai != AI_NONE) ? BL_PC : BL_MOB; + struct block_list *fr = NULL; map->foreachinrange(mob->getfriendstatus_sub, &md->bl, 8, type, md, cond1, cond2, &fr); + return fr; } -- cgit v1.2.3-70-g09d2