diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2012-07-06 22:16:06 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2012-07-06 22:16:06 -0700 |
commit | 75e3dc137ae4916a47cdd748fd10cd4ed9c438b3 (patch) | |
tree | 0048507fe5bf0f5f83acab439515154391a9d7ff /src/map/mob.c | |
parent | 0b8e004a6b70834d1bcb913c704cc83071defa40 (diff) | |
download | tmwa-75e3dc137ae4916a47cdd748fd10cd4ed9c438b3.tar.gz tmwa-75e3dc137ae4916a47cdd748fd10cd4ed9c438b3.tar.bz2 tmwa-75e3dc137ae4916a47cdd748fd10cd4ed9c438b3.tar.xz tmwa-75e3dc137ae4916a47cdd748fd10cd4ed9c438b3.zip |
Make mob splash range configurable
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 439287e..67ceb03 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -931,8 +931,11 @@ static int mob_attack (struct mob_data *md, unsigned int tick, int data) md->target_lv = battle_weapon_attack (&md->bl, tbl, tick, 0); // If you are reading this, please note: // it is highly platform-specific that this even works at all. - if (tbl->type == BL_PC) - map_foreachincell(mob_ancillary_attack, tbl->m, tbl->x, tbl->y, BL_PC, + int radius = battle_config.mob_splash_radius; + if (radius >= 0 && tbl->type == BL_PC) + map_foreachinarea(mob_ancillary_attack, + tbl->m, tbl->x - radius, tbl->y - radius, tbl->x + radius, tbl->y + radius, + BL_PC, &md->bl, tbl, tick); if (!(battle_config.monster_cloak_check_type & 2) |