From eadab5ba5011a8b999c9a5674081df81c2d0b5a2 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 14 Mar 2006 13:38:49 +0000 Subject: - Fixed player auto-attack not cancelling when dead. - Some cleanups in skill_unit nooverlapping code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5595 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 1 + src/map/skill.c | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src/map') diff --git a/src/map/pc.c b/src/map/pc.c index e20f15f75..acdf2e62c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5311,6 +5311,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) duel_reject(sd->duel_invite, sd); } + pc_stopattack(sd); pc_stop_walking(sd,0); skill_castcancel(&sd->bl,0); // 詠唱の中止 skill_stop_dancing(&sd->bl); //You should stop dancing when dead... [Skotlex] diff --git a/src/map/skill.c b/src/map/skill.c index 0498d04c0..0c689a40f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2054,13 +2054,9 @@ int skill_area_sub( struct block_list *bl,va_list ap ) static int skill_check_unit_range_sub( struct block_list *bl,va_list ap ) { struct skill_unit *unit; - int *c; int skillid,g_skillid; - nullpo_retr(0, bl); - nullpo_retr(0, ap); - nullpo_retr(0, unit = (struct skill_unit *)bl); - nullpo_retr(0, c = va_arg(ap,int *)); + unit = (struct skill_unit *)bl; if(bl->prev == NULL || bl->type != BL_SKILL) return 0; @@ -2100,14 +2096,11 @@ static int skill_check_unit_range_sub( struct block_list *bl,va_list ap ) break; } - (*c)++; - return 1; } int skill_check_unit_range(int m,int x,int y,int skillid,int skilllv) { - int c = 0; int range = skill_get_unit_range(skillid, skilllv); int layout_type = skill_get_unit_layout_type(skillid,skilllv); if (layout_type==-1 || layout_type>MAX_SQUARE_LAYOUT) { @@ -2117,10 +2110,8 @@ int skill_check_unit_range(int m,int x,int y,int skillid,int skilllv) // とりあえず?ウ方形のユニットレイアウトのみ対応 range += layout_type; - map_foreachinarea(skill_check_unit_range_sub,m, - x-range,y-range,x+range,y+range,BL_SKILL,&c,skillid); - - return c; + return map_foreachinarea(skill_check_unit_range_sub,m, + x-range,y-range,x+range,y+range,BL_SKILL,skillid); } static int skill_check_unit_range2_sub( struct block_list *bl,va_list ap ) -- cgit v1.2.3-70-g09d2