summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 03c92c07a..0ab76c6b0 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1233,10 +1233,31 @@ ACMD_FUNC(hide)
else
status_set_viewdata(&sd->bl, sd->status.class_);
clif_displaymessage(fd, msg_txt(10)); // Invisible: Off
+
+ if( map[sd->bl.m].flag.pvp )
+ {// increment the number of pvp players on the map
+ map[sd->bl.m].users_pvp++;
+
+ if( !map[sd->bl.m].flag.pvp_nocalcrank )
+ {// register the player for ranking calculations
+ sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 );
+ }
+ }
} else {
sd->sc.option |= OPTION_INVISIBLE;
sd->vd.class_ = INVISIBLE_CLASS;
clif_displaymessage(fd, msg_txt(11)); // Invisible: On
+
+ if( map[sd->bl.m].flag.pvp )
+ {// decrement the number of pvp players on the map
+ map[sd->bl.m].users_pvp--;
+
+ if( !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER )
+ {// unregister the player for ranking
+ delete_timer( sd->pvp_timer, pc_calc_pvprank_timer );
+ sd->pvp_timer = INVALID_TIMER;
+ }
+ }
}
clif_changeoption(&sd->bl);