From c83f41a5a358e69ba66616cae1df17f2377907d9 Mon Sep 17 00:00:00 2001 From: Playtester <3785983+Playtester@users.noreply.github.com> Date: Mon, 20 May 2024 09:14:18 +0200 Subject: [PATCH] Consistent Dirx / Diry Array Usage (#8343) - All skills now use the globally defined dirx/diry variables instead of defining their own --- src/map/battle.cpp | 4 +--- src/map/skill.cpp | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/map/battle.cpp b/src/map/battle.cpp index ce5c6810ba..1b3403f8cb 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1426,11 +1426,9 @@ bool battle_status_block_damage(struct block_list *src, struct block_list *targe // ATK_DEF Type if ((sce = sc->getSCE(SC_LIGHTNINGWALK)) && !(flag & BF_MAGIC) && flag&BF_LONG && rnd() % 100 < sce->val1) { - const int dx[8] = { 0,-1,-1,-1,0,1,1,1 }; - const int dy[8] = { 1,1,0,-1,-1,-1,0,1 }; uint8 dir = map_calc_dir(target, src->x, src->y); - if (unit_movepos(target, src->x - dx[dir], src->y - dy[dir], 1, 1)) { + if (unit_movepos(target, src->x - dirx[dir], src->y - diry[dir], 1, 1)) { clif_blown(target); unit_setdir(target, dir); } diff --git a/src/map/skill.cpp b/src/map/skill.cpp index c8088fdcd7..d295c1f40d 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -6625,11 +6625,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint break; case RA_WUGSTRIKE: if( sd && pc_isridingwug(sd) ){ - short x[8]={0,-1,-1,-1,0,1,1,1}; - short y[8]={1,1,0,-1,-1,-1,0,1}; uint8 dir = map_calc_dir(bl, src->x, src->y); - if( unit_movepos(src, bl->x+x[dir], bl->y+y[dir], 1, 1) ) { + if( unit_movepos(src, bl->x+dirx[dir], bl->y+diry[dir], 1, 1) ) { clif_blown(src); skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag); } @@ -17531,10 +17529,8 @@ bool skill_check_condition_castbegin( map_session_data& sd, uint16 skill_id, uin { if( skill_lv < 3 && ((sd.bl.type == BL_PC && battle_config.pc_cloak_check_type&1) || (sd.bl.type != BL_PC && battle_config.monster_cloak_check_type&1) )) { //Check for walls. - static int dx[DIR_MAX] = { 0, 1, 0, -1, -1, 1, 1, -1}; - static int dy[DIR_MAX] = {-1, 0, 1, 0, -1, -1, 1, 1}; int dir; - ARR_FIND( 0, DIR_MAX, dir, map_getcell(sd.bl.m, sd.bl.x+dx[dir], sd.bl.y+dy[dir], CELL_CHKNOPASS) != 0 ); + ARR_FIND( 0, DIR_MAX, dir, map_getcell(sd.bl.m, sd.bl.x+dirx[dir], sd.bl.y+diry[dir], CELL_CHKNOPASS) != 0 ); if( dir == DIR_MAX ) { clif_skill_fail( sd, skill_id ); return false;