diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 17 | ||||
-rw-r--r-- | src/map/skill.c | 13 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 09b2d4623..8025f7014 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9889,22 +9889,21 @@ void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd) { */ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd) { + int skill_num; RFIFOHEAD(fd); + skill_num = RFIFOW(fd,2); - if (clif_cant_act(sd)) + if(skill_num != sd->menuskill_id) return; - if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS)) + if (clif_cant_act(sd)) + { + sd->menuskill_id = sd->menuskill_lv = 0; return; - - if(sd->menuskill_id && - sd->menuskill_id != RFIFOW(fd,2) && - sd->menuskill_id != SA_AUTOSPELL) - return; //Can't use skills while a menu is open. + } pc_delinvincibletimer(sd); - - skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4)); + skill_castend_map(sd,skill_num,(char*)RFIFOP(fd,4)); } /*========================================== * ƒƒ‚—v‹ diff --git a/src/map/skill.c b/src/map/skill.c index 022da6ec7..4c3559b9f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6327,9 +6327,13 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m //Simplify skill_failed code. #define skill_failed(sd) { sd->menuskill_id = sd->menuskill_lv = 0; } + if(skill_num != sd->menuskill_id) + return 0; - if( sd->bl.prev == NULL || pc_isdead(sd) ) + if( sd->bl.prev == NULL || pc_isdead(sd) ) { + skill_failed(sd); return 0; + } if(sd->sc.opt1 || sd->sc.option&OPTION_HIDE ) { skill_failed(sd); @@ -6343,11 +6347,10 @@ int skill_castend_map (struct map_session_data *sd, int skill_num, const char *m sd->sc.data[SC_DANCING].timer!=-1 || sd->sc.data[SC_BERSERK].timer != -1 || sd->sc.data[SC_MARIONETTE].timer != -1 - )) - return 0; - - if( skill_num != sd->menuskill_id) + )) { + skill_failed(sd); return 0; + } if (strlen(map) > MAP_NAME_LENGTH_EXT-1) { //Map_length check, as it is sent by the client and we shouldn't trust it [Skotlex] diff --git a/src/map/unit.c b/src/map/unit.c index 0cfdd9087..d8be6cc78 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -971,7 +971,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int break; case KN_CHARGEATK: //Taken from jA: Casttime is increased by dist/3*100% - casttime = casttime * ((distance_bl(src,target)-1)/3+1); + casttime+= casttime * (distance_bl(src,target)-1)/3; break; } |