summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-04 04:17:27 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-04 04:17:27 +0000
commitb63504c6445eed61f637f9f9e3dee769ac7dcc7c (patch)
tree1d1ef9ed55c66ab8d5056a6cff7dcb4d1384fda5 /src
parentbdb423140e5779fae596257d24665762e33f1bdd (diff)
downloadhercules-b63504c6445eed61f637f9f9e3dee769ac7dcc7c.tar.gz
hercules-b63504c6445eed61f637f9f9e3dee769ac7dcc7c.tar.bz2
hercules-b63504c6445eed61f637f9f9e3dee769ac7dcc7c.tar.xz
hercules-b63504c6445eed61f637f9f9e3dee769ac7dcc7c.zip
Modified battle_range to check if sd is null first
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@445 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index be22723d3..6b1d68625 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4949,7 +4949,7 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range)
int dx,dy;
struct walkpath_data wpd;
int arange;
-
+
nullpo_retr(0, src);
nullpo_retr(0, bl);
@@ -4962,10 +4962,14 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range)
if( range>0 && range < arange ) {// 遠すぎる
// be lenient if the skill was cast before we have moved to the correct position [Celest]
- if (src->type != BL_PC ||
- (bl->type == BL_PC && ((struct map_session_data *)bl)->walktimer != -1 &&
- !((arange-=battle_config.skill_range_leniency)<=range)))
+ if (src->type != BL_PC)
return 0;
+ else if (src->type == BL_PC) {
+ struct map_session_data *sd;
+ nullpo_retr(0, (sd=(struct map_session_data *)bl));
+ if (sd->walktimer != -1 && !((arange-=battle_config.skill_range_leniency)<=range))
+ return 0;
+ }
}
if( arange<2 ) // 同じマスか隣接