From 476c3bcf31589957b9624e638150daaf77952028 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 2 Jun 2006 23:36:13 +0000 Subject: - Fixed a bug in unit_can_reach_bl which breaks path seeking when the target is near obstacles. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6950 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/unit.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index fe7d20a41..4b618741a 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/06/02 + * Fixed a bug in unit_can_reach_bl which breaks path seeking when the + target is near obstacles. [Skotlex] * Updated offensive use of Sanctuary to function like on the official servers [MasterOfMuppets] * Changed the interval between waterballs from 150 to 250 milliseconds [MasterOfMuppets] * Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it diff --git a/src/map/unit.c b/src/map/unit.c index 5852f9ecb..d8ef113e7 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1080,8 +1080,8 @@ int unit_attack(struct block_list *src,int target_id,int type) return 0; } - if(!(src->type == BL_MOB && ((TBL_MOB *)src)->state.killer) && (battle_check_target(src,target,BCT_ENEMY)<=0 || - !status_check_skilluse(src, target, 0, 0)) + if(battle_check_target(src,target,BCT_ENEMY)<=0 || + !status_check_skilluse(src, target, 0, 0) ) { unit_unattackable(src); return 1; @@ -1156,7 +1156,7 @@ int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, i dx=(dx>0)?1:((dx<0)?-1:0); dy=(dy>0)?1:((dy<0)?-1:0); - if (map_getcell(tbl->m,tbl->x+dx,tbl->y+dy,CELL_CHKNOREACH)) + if (map_getcell(tbl->m,tbl->x-dx,tbl->y-dy,CELL_CHKNOREACH)) { //Look for a suitable cell to place in. for(i=0;i<9 && map_getcell(tbl->m,tbl->x-dirx[i],tbl->y-diry[i],CELL_CHKNOREACH);i++); if (i==9) return 0; //No valid cells. -- cgit v1.2.3-70-g09d2