summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-15 18:18:12 -0300
committershennetsind <ind@henn.et>2013-05-15 18:18:12 -0300
commit06ca68f1aae5e1dec3631d62cb006936f55320de (patch)
tree222adca88f917811146f3ebc7114b47e51e86000 /src/map/unit.c
parent60de1463d87f90ed7fb2bc9ec379d9abad1ef3c2 (diff)
downloadhercules-06ca68f1aae5e1dec3631d62cb006936f55320de.tar.gz
hercules-06ca68f1aae5e1dec3631d62cb006936f55320de.tar.bz2
hercules-06ca68f1aae5e1dec3631d62cb006936f55320de.tar.xz
hercules-06ca68f1aae5e1dec3631d62cb006936f55320de.zip
Fixed Bug #7238
http://hercules.ws/board/tracker/issue-7238-skills-effect-showing-up-without-state-change-occuring/ Special Thanks to Xgear~! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index a05be7ea0..2847052f6 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1077,8 +1077,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if( skill->get_inf(skill_id)&INF_SELF_SKILL && skill->get_nk(skill_id)&NK_NO_DAMAGE )// exploit fix
target_id = src->id;
temp = 1;
- } else
- if ( target_id == src->id &&
+ } else if ( target_id == src->id &&
skill->get_inf(skill_id)&INF_SELF_SKILL &&
skill->get_inf2(skill_id)&INF2_NO_TARGET_SELF )
{
@@ -1091,38 +1090,37 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if(skill->not_ok(skill_id, sd)) // [MouseJstr]
return 0;
- switch(skill_id)
- { //Check for skills that auto-select target
- case MO_CHAINCOMBO:
- if (sc && sc->data[SC_BLADESTOP]){
- if ((target=map_id2bl(sc->data[SC_BLADESTOP]->val4)) == NULL)
+ switch(skill_id) { //Check for skills that auto-select target
+ case MO_CHAINCOMBO:
+ if (sc && sc->data[SC_BLADESTOP]){
+ if ((target=map_id2bl(sc->data[SC_BLADESTOP]->val4)) == NULL)
+ return 0;
+ }
+ break;
+ case WE_MALE:
+ case WE_FEMALE:
+ if (!sd->status.partner_id)
return 0;
- }
- break;
- case WE_MALE:
- case WE_FEMALE:
- if (!sd->status.partner_id)
- return 0;
- target = (struct block_list*)map_charid2sd(sd->status.partner_id);
- if (!target) {
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- return 0;
- }
- break;
+ target = (struct block_list*)map_charid2sd(sd->status.partner_id);
+ if (!target) {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ break;
}
if (target)
target_id = target->id;
}
+
if (src->type==BL_HOM)
- switch(skill_id)
- { //Homun-auto-target skills.
- case HLIF_HEAL:
- case HLIF_AVOID:
- case HAMI_DEFENCE:
- case HAMI_CASTLE:
- target = battle->get_master(src);
- if (!target) return 0;
- target_id = target->id;
+ switch(skill_id) { //Homun-auto-target skills.
+ case HLIF_HEAL:
+ case HLIF_AVOID:
+ case HAMI_DEFENCE:
+ case HAMI_CASTLE:
+ target = battle->get_master(src);
+ if (!target) return 0;
+ target_id = target->id;
}
if( !target ) // choose default target