summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-08 07:52:48 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-08 08:09:51 +0200
commitdf6075407ae9434a2179d9d7bf75a9e341bcd595 (patch)
treec18c55dc084f8cbde7e9b409c57f7c9d9c74c189 /src
parent18c93185ecf6b150d027a070c49c46dbd2ec45c1 (diff)
downloadhercules-df6075407ae9434a2179d9d7bf75a9e341bcd595.tar.gz
hercules-df6075407ae9434a2179d9d7bf75a9e341bcd595.tar.bz2
hercules-df6075407ae9434a2179d9d7bf75a9e341bcd595.tar.xz
hercules-df6075407ae9434a2179d9d7bf75a9e341bcd595.zip
Use pc_(un)hide() in ACMD(hide)
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 91ddc3ef9..00073e544 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -962,39 +962,10 @@ ACMD(option)
*------------------------------------------*/
ACMD(hide)
{
- if (pc_isinvisible(sd)) {
- sd->sc.option &= ~OPTION_INVISIBLE;
- if (sd->disguise != -1 )
- status->set_viewdata(&sd->bl, sd->disguise);
- else
- status->set_viewdata(&sd->bl, sd->status.class);
- clif->message(fd, msg_fd(fd,10)); // Invisible: Off
-
- // increment the number of pvp players on the map
- map->list[sd->bl.m].users_pvp++;
-
- if( map->list[sd->bl.m].flag.pvp && !map->list[sd->bl.m].flag.pvp_nocalcrank ) {
- // register the player for ranking calculations
- sd->pvp_timer = timer->add( timer->gettick() + 200, pc->calc_pvprank_timer, sd->bl.id, 0 );
- }
- //bugreport:2266
- map->foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl);
- } else {
- clif->clearunit_area(&sd->bl, CLR_OUTSIGHT);
- sd->sc.option |= OPTION_INVISIBLE;
- sd->vd.class = INVISIBLE_CLASS;
- clif->message(fd, msg_fd(fd,11)); // Invisible: On
-
- // decrement the number of pvp players on the map
- map->list[sd->bl.m].users_pvp--;
-
- if( map->list[sd->bl.m].flag.pvp && !map->list[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {
- // unregister the player for ranking
- timer->delete( sd->pvp_timer, pc->calc_pvprank_timer );
- sd->pvp_timer = INVALID_TIMER;
- }
- }
- clif->changeoption(&sd->bl);
+ if (pc_isinvisible(sd))
+ pc->unhide(sd, true);
+ else
+ pc->hide(sd, true);
return true;
}