Adjusts map_foreachindir to include caster's cell (#5314)

* Fixes #3502.
* Adjusts map_foreachindir to include the caster's cell when calculating area of effect.
* Adds battle config 'skill_eightpath_same_cell' to allow toggling of the effect.
Thanks to @mrjnumber1!
This commit is contained in:
Aleos
2020-08-13 11:16:55 -04:00
committed by GitHub
parent 78676d8a6f
commit 3060865aa0
4 changed files with 8 additions and 2 deletions

View File

@@ -1420,7 +1420,7 @@ int map_foreachindir(int(*func)(struct block_list*, va_list), int16 m, int16 x0,
rx = (bl->x - x0);
ry = (bl->y - y0);
//Do not hit source cell
if (rx == 0 && ry == 0)
if (battle_config.skill_eightpath_same_cell == 0 && rx == 0 && ry == 0)
continue;
//This turns it so that the area that is hit is always with positive rx and ry
rx *= dx;
@@ -1456,7 +1456,7 @@ int map_foreachindir(int(*func)(struct block_list*, va_list), int16 m, int16 x0,
rx = (bl->x - x0);
ry = (bl->y - y0);
//Do not hit source cell
if (rx == 0 && ry == 0)
if (battle_config.skill_eightpath_same_cell == 0 && rx == 0 && ry == 0)
continue;
//This turns it so that the area that is hit is always with positive rx and ry
rx *= dx;