summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-20 17:25:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-20 17:25:05 +0000
commit386421a953a51e90fa56da5e294ecdac58647549 (patch)
tree12803313574bbb74967056a70d0b8362f4da2816 /src/map/unit.c
parent787638a2dbf76c57154b94f8e3fb2d758bee486c (diff)
downloadhercules-386421a953a51e90fa56da5e294ecdac58647549.tar.gz
hercules-386421a953a51e90fa56da5e294ecdac58647549.tar.bz2
hercules-386421a953a51e90fa56da5e294ecdac58647549.tar.xz
hercules-386421a953a51e90fa56da5e294ecdac58647549.zip
- Fixed itemskill variable being cleared before parsing the skill, this causes auto-casted teleport to fail to skip the skill menu. It is now cleared on castend_pos/id directly.
- The item skill/lv variables now use 0 as default to signal they aren't being used (instead of -1) - Skills with state 'move_enable' will now do a "walk path" check between target cell/object and caster instead of a "shoot path" check, this would fix skills like snap or charge from letting you "teleport" across pits. - Fixed a possible double map_addblock when hatching a pet egg right before going through a warp. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9275 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index f3b0562e8..15571bc99 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -880,10 +880,18 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
//Check range when not using skill on yourself or is a combo-skill during attack
//(these are supposed to always have the same range as your attack)
- if(src->id != target_id && (!temp || ud->attacktimer == -1) &&
- !battle_check_range(src,target,skill_get_range2(src, skill_num,skill_lv)
- +(skill_num==RG_CLOSECONFINE?0:1))) //Close confine is exploitable thanks to this extra range "feature" of the client. [Skotlex]
- return 0;
+ if(src->id != target_id && (!temp || ud->attacktimer == -1))
+ {
+ if (skill_get_state(ud->skillid) == ST_MOVE_ENABLE)
+ {
+ if (!unit_can_reach_bl(src, target, skill_get_range2(src, skill_num,skill_lv)+1, 1, NULL, NULL))
+ return 0; //Walk-path check failed.
+ } else
+ if (!battle_check_range(src, target, skill_get_range2(src, skill_num,skill_lv)
+ +(skill_num==RG_CLOSECONFINE?0:1)))
+ //Close confine is exploitable thanks to this extra range "feature" of the client. [Skotlex]
+ return 0; //Arrow-path check failed.
+ }
if (!temp) //Stop attack on non-combo skills [Skotlex]
unit_stop_attack(src);
@@ -1041,9 +1049,14 @@ int unit_skilluse_pos2( struct block_list *src, int skill_x, int skill_y, int sk
bl.m = src->m;
bl.x = skill_x;
bl.y = skill_y;
- if(skill_num != TK_HIGHJUMP &&
- !battle_check_range(src,&bl,skill_get_range2(src, skill_num,skill_lv)+1))
- return 0;
+
+ if (skill_get_state(ud->skillid) == ST_MOVE_ENABLE)
+ {
+ if (!unit_can_reach_bl(src, &bl, skill_get_range2(src, skill_num,skill_lv)+1, 1, NULL, NULL))
+ return 0; //Walk-path check failed.
+ } else
+ if (!battle_check_range(src,&bl,skill_get_range2(src, skill_num,skill_lv)+1))
+ return 0; //Arrow-path check failed.
unit_stop_attack(src);
ud->state.skillcastcancel = castcancel;
@@ -1837,7 +1850,6 @@ int unit_free(struct block_list *bl, int clrtype) {
intif_homunculus_requestdelete(hd->homunculus.hom_id);
if (sd) sd->status.hom_id = 0;
}
- aFree(hd); // Remember to free it! [Lance]
if(sd) sd->hd = NULL;
}