summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-02 14:31:24 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-02 14:31:24 +0000
commit04b3dda0bc65e465782bbc3b85b6a09ed8bb832d (patch)
tree071fdfb776e3ab642301937f3b6c0e2a9f51b0c5 /src/map/atcommand.c
parent0bd338e806317f7ed248e379da14b6be250242f4 (diff)
downloadhercules-04b3dda0bc65e465782bbc3b85b6a09ed8bb832d.tar.gz
hercules-04b3dda0bc65e465782bbc3b85b6a09ed8bb832d.tar.bz2
hercules-04b3dda0bc65e465782bbc3b85b6a09ed8bb832d.tar.xz
hercules-04b3dda0bc65e465782bbc3b85b6a09ed8bb832d.zip
* Quick fix to char command checking gm level of the target player instead of the command user (bugreport:3255).
* Disalbed @jump/@jumpto usage when dead. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14117 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e638d6513..d9b66a2a3 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -528,7 +528,13 @@ int atcommand_jumpto(const int fd, struct map_session_data* sd, const char* comm
clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
return -1;
}
-
+
+ if( pc_isdead(sd) )
+ {
+ clif_displaymessage(fd, "You cannot use this command when dead.");
+ return -1;
+ }
+
pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, 3);
sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s
clif_displaymessage(fd, atcmd_output);
@@ -554,6 +560,12 @@ int atcommand_jump(const int fd, struct map_session_data* sd, const char* comman
return -1;
}
+ if( pc_isdead(sd) )
+ {
+ clif_displaymessage(fd, "You cannot use this command when dead.");
+ return -1;
+ }
+
if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
clif_displaymessage(fd, msg_txt(2));
@@ -8894,6 +8906,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
char command[100];
char output[200];
int x, y, z;
+ int lv = 0;
//Reconstructed message
char atcmd_msg[200];
@@ -8999,11 +9012,13 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
}
//Attempt to use the command
+ if( strcmpi("adjgmlvl",command+1) && ssd ) { lv = ssd->gmlevel; ssd->gmlevel = sd->gmlevel; }
if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) )
{
sprintf(output,msg_txt(154), command); // %s failed.
clif_displaymessage(fd, output);
}
+ if( strcmpi("adjgmlvl",command+1) && ssd ) ssd->gmlevel = lv;
//Log atcommands
if( log_config.gm && info->level >= log_config.gm && *atcmd_msg == atcommand_symbol )