From 2eda4c20fec88ebefe0fbf74c2db33b0c83890e9 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 19 Apr 2014 18:17:09 +0200 Subject: Corrected some issues in 69ca0aa and 446ce4a Signed-off-by: Haru --- src/map/atcommand.c | 19 +++++++------------ src/map/pc.c | 6 +++--- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e9b00cce6..5fd0faf86 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -466,17 +466,12 @@ ACMD(where) { *------------------------------------------*/ ACMD(jumpto) { struct map_session_data *pl_sd = NULL; - + if (!message || !*message) { clif->message(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). return false; } - if( message == sd->status.name || (atoi(message)) == sd->status.char_id ) { - clif->message(fd, msg_txt(253)); // You already are at your destination! - return false; - } - if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map. return false; @@ -486,7 +481,7 @@ ACMD(jumpto) { clif->message(fd, msg_txt(864)); // "You cannot use this command when dead." return false; } - + if((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) { clif->message(fd, msg_txt(3)); // Character not found. return false; @@ -499,13 +494,13 @@ ACMD(jumpto) { if( pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y ) { clif->message(fd, msg_txt(253)); // You already are at your destination! - return false; - } - + return false; + } + pc->setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s - clif->message(fd, atcmd_output); - + clif->message(fd, atcmd_output); + return true; } diff --git a/src/map/pc.c b/src/map/pc.c index 9ee65d2d2..c6bab4cfc 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7140,9 +7140,9 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } // Remove autotrade to prevent autotrading from save point - if( sd->state.standalone || sd->state.autotrade - && (map->list[sd->bl.m].flag.pvp || map->list[sd->bl.m].flag.gvg) - ) { + if( (sd->state.standalone || sd->state.autotrade) + && (map->list[sd->bl.m].flag.pvp || map->list[sd->bl.m].flag.gvg) + ) { sd->state.autotrade = 0; sd->state.standalone = 0; pc->autotrade_update(sd,PAUC_REMOVE); -- cgit v1.2.3-70-g09d2