summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-14 07:57:04 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-14 07:57:04 +0200
commit55544037331569a5431751cb1df9d5576023b338 (patch)
treecfe17d417e7a1231d9948b19bf877297b1b6a549 /src/map/mob.c
parentf1f32ffa5d5a28654a1e7cdaf6638e6f5adfc6c8 (diff)
downloadhercules-55544037331569a5431751cb1df9d5576023b338.tar.gz
hercules-55544037331569a5431751cb1df9d5576023b338.tar.bz2
hercules-55544037331569a5431751cb1df9d5576023b338.tar.xz
hercules-55544037331569a5431751cb1df9d5576023b338.zip
Apply code style to mob_getfriendstatus()
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c13
1 files changed, 12 insertions, 1 deletions
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;
}