diff options
author | shennetsind <ind@henn.et> | 2014-01-24 18:18:13 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-01-24 18:18:13 -0200 |
commit | 7438e401b4209198691d3c8ca65b6c702338fa41 (patch) | |
tree | 59b2f8f11d2a64d8eeb6a05f4e9fef074a1cf8c9 /src/map/unit.c | |
parent | acc992ac2838f6380ebf2b2f8a514e86c2b750d9 (diff) | |
download | hercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.gz hercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.bz2 hercules-7438e401b4209198691d3c8ca65b6c702338fa41.tar.xz hercules-7438e401b4209198691d3c8ca65b6c702338fa41.zip |
Follow up e587d715cbc3
Fixed an issue where character position would not be instantly updated upon using a skill with casttime while in hiding (e.g. cloaking -> soul break), Special Thanks to Michieru!
Turned the feature optional, by commenting out ANTI_MAYAP_CHEAT in src/config/secure.h due it not being entirely able to mimic skill casting out of hiding (read the description in secure.h for further details).
Also fixed some status.c indentation which, unfortunately, considerably increased this commits size.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index af52e6dfb..7b37be266 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1345,6 +1345,19 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui casttime = 0; } + if( sc ) { + /** + * why the if else chain: these 3 status do not stack, so its efficient that way. + **/ + if( sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&4) && skill_id != AS_CLOAKING ) { + status_change_end(src, SC_CLOAKING, INVALID_TIMER); + if (!src->prev) return 0; //Warped away! + } else if( sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4) && skill_id != GC_CLOAKINGEXCEED ) { + status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER); + if (!src->prev) return 0; + } + } + if(!ud->state.running) //need TK_RUN or WUGDASH handler to be done before that, see bugreport:6026 unit->stop_walking(src,1);// eventhough this is not how official works but this will do the trick. bugreport:6829 @@ -1401,20 +1414,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui ud->skill_id = skill_id; ud->skill_lv = skill_lv; - if( sc ) { - /** - * why the if else chain: these 3 status do not stack, so its efficient that way. - **/ - if( sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&4) && skill_id != AS_CLOAKING ) { - status_change_end(src, SC_CLOAKING, INVALID_TIMER); - if (!src->prev) return 0; //Warped away! - } else if( sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4) && skill_id != GC_CLOAKINGEXCEED ) { - status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER); - if (!src->prev) return 0; - } - } - - if( casttime > 0 ) { ud->skilltimer = timer->add( tick+casttime, skill->castend_id, src->id, 0 ); if( sd && (pc->checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) ) |