summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/unit.c18
2 files changed, 20 insertions, 4 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 215086532..1e18e4941 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4637,6 +4637,12 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
sd->md->ud.dir = sd->ud.dir;
}
+ // If the player is changing maps, end cloaking and cloaking exceed.
+ if ( sd->state.changemap && sd->sc.count )
+ {
+ status_change_end(&sd->bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(&sd->bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
+ }
return 0;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index d51c41638..848dd6dea 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1978,7 +1978,6 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
// Do not reset can-act delay. [Skotlex]
ud->attackabletime = ud->canmove_tick /*= ud->canact_tick*/ = gettick();
-
if(sc && sc->count ) { //map-change/warp dispells.
status_change_end(bl, SC_BLADESTOP, INVALID_TIMER);
status_change_end(bl, SC_BASILICA, INVALID_TIMER);
@@ -1994,9 +1993,13 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
status_change_end(bl, SC_CLOSECONFINE, INVALID_TIMER);
status_change_end(bl, SC_CLOSECONFINE2, INVALID_TIMER);
status_change_end(bl, SC_HIDING, INVALID_TIMER);
- status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ // Ensure the bl is a PC; if so, we'll handle the removal of cloaking and cloaking exceed later
+ if ( bl->type != BL_PC )
+ {
+ status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
+ }
status_change_end(bl, SC_CHASEWALK, INVALID_TIMER);
- status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
if (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF)
status_change_end(bl, SC_GOSPEL, INVALID_TIMER);
status_change_end(bl, SC_CHANGE, INVALID_TIMER);
@@ -2036,9 +2039,16 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
guild_reply_reqalliance(sd,sd->guild_alliance_account,0);
if(sd->menuskill_id)
sd->menuskill_id = sd->menuskill_val = 0;
- if( sd->touching_id )
+ if( sd->touching_id && !sd->state.warping ) // Only if the player isn't warping and there is a touching_id.
npc_touchnext_areanpc(sd,true);
+ // Check if warping and not changing the map.
+ if ( sd->state.warping && !sd->state.changemap )
+ {
+ status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
+ status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
+ }
+
sd->npc_shopid = 0;
sd->adopt_invite = 0;