summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-21 23:19:22 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-21 23:19:22 +0000
commit5471705b4190f390029d990cda966f95db5d19a7 (patch)
treee8bf235065012bb15e08781d7aa531b427ef6bfe /src/map/unit.c
parenteba83e0231886458138a7344ce7beaa32087b6a7 (diff)
downloadhercules-5471705b4190f390029d990cda966f95db5d19a7.tar.gz
hercules-5471705b4190f390029d990cda966f95db5d19a7.tar.bz2
hercules-5471705b4190f390029d990cda966f95db5d19a7.tar.xz
hercules-5471705b4190f390029d990cda966f95db5d19a7.zip
Fixed bugreport:5462, Cursed Circle target is no longer able to move.
Also Fixed Cursed Circle effect not going off if status is ended normally. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15743 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c59
1 files changed, 38 insertions, 21 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 36a57a59d..f6ef79e56 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -912,6 +912,7 @@ int unit_can_move(struct block_list *bl)
|| sc->data[SC_MAGNETICFIELD]
|| sc->data[SC__MANHOLE]
|| (sc->data[SC_FEAR] && sc->data[SC_FEAR]->val2 > 0)
+ || sc->data[SC_CURSEDCIRCLE_TARGET]
))
return 0;
}
@@ -1277,18 +1278,27 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
ud->skillid = skill_num;
ud->skilllv = skill_lv;
- if( sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&4) && skill_num != AS_CLOAKING )
- {
- status_change_end(src, SC_CLOAKING, INVALID_TIMER);
- if (!src->prev) return 0; //Warped away!
- }
-
- if( sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4) && skill_num != GC_CLOAKINGEXCEED )
- {
- status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER);
- if (!src->prev) return 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_num != 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_num != GC_CLOAKINGEXCEED ) {
+ status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER);
+ if (!src->prev) return 0;
+ } else
+ status_change_end(src,SC_CAMOUFLAGE,-1);
+
+ if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
+ sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
+ status_change_end(src,SC_CURSEDCIRCLE_ATKER,-1);
+ }
+
}
+
if( casttime > 0 )
{
ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
@@ -1396,18 +1406,25 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
ud->skilly = skill_y;
ud->skilltarget = 0;
- if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&4))
- {
- status_change_end(src, SC_CLOAKING, INVALID_TIMER);
- if (!src->prev) return 0; //Warped away!
- }
-
- if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4))
- {
- status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
- if (!src->prev) return 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)) {
+ 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)) {
+ status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
+ if (!src->prev) return 0;
+ } else
+ status_change_end(src,SC_CAMOUFLAGE,-1);
+ if( sc->data[SC_CURSEDCIRCLE_ATKER] ) {
+ sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1;
+ status_change_end(src,SC_CURSEDCIRCLE_ATKER,-1);
+ }
+
+ }
if( casttime > 0 )
{
unit_stop_walking(src,1);