summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c18
1 files changed, 14 insertions, 4 deletions
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;