diff options
author | sketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-02-23 18:32:43 +0000 |
---|---|---|
committer | sketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-02-23 18:32:43 +0000 |
commit | 0c2aa46ad3af72ade35d6389a5227f7b8bc0c3c0 (patch) | |
tree | 5c9aead5af5ef4f0dca17dc99c3b51ab863ca45a /src/map/script.c | |
parent | c2e7fc730554fc9dcd572969a4c1d0e0910ac846 (diff) | |
download | hercules-0c2aa46ad3af72ade35d6389a5227f7b8bc0c3c0.tar.gz hercules-0c2aa46ad3af72ade35d6389a5227f7b8bc0c3c0.tar.bz2 hercules-0c2aa46ad3af72ade35d6389a5227f7b8bc0c3c0.tar.xz hercules-0c2aa46ad3af72ade35d6389a5227f7b8bc0c3c0.zip |
* Consolidated is_atcommand() and is_atcommand_sub()
- replaced gmlvl arg with a flag arg for internal/player generated checks. (dummy sds that used this arg are given gm levels)
- each command check runs through is_atcommand() and is checked for its origin (internal or player generated)
- charcommands are also parsed in this function.
- script atcommand/charcommand function calls to is_atcommand() have been updated
- also updated some clif/map functions calls to is_atcommand()
* charcommands should now log properly with the target of the command included.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13545 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/map/script.c b/src/map/script.c index fc65a3d7e..c2ec1ddc8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10733,7 +10733,8 @@ BUILDIN_FUNC(atcommand) cmd++; } - is_atcommand_sub(fd, sd, cmd, 99); + sd->gmlevel = 99; + is_atcommand(fd, sd, cmd, 0); return 0; } @@ -10742,11 +10743,8 @@ BUILDIN_FUNC(charcommand) { TBL_PC dummy_sd; TBL_PC* sd; - TBL_PC* temp_sd; - char output[200], temp[200], command[200], charname[NAME_LENGTH], param[200]; int fd; const char* cmd; - const char* message; cmd = script_getstr(st,2); @@ -10767,24 +10765,14 @@ BUILDIN_FUNC(charcommand) } } - if (*cmd == charcommand_symbol) - { - if (sscanf(cmd, "%99s \"%23[^\"]\" %99[^\n]", command, charname, param) > 2 - || sscanf(cmd, "%99s %23s %99[^\n]", command, charname, param) > 2) - { - if ( (temp_sd = map_nick2sd(charname)) != NULL ) - { - sprintf(output, "%s %s", cmd, param); - memcpy(temp, output, sizeof(output)); - message = temp; - is_atcommand_sub(fd,sd,message,99); - } - } - } - else { + if (*cmd != charcommand_symbol) { ShowWarning("script: buildin_charcommand: No '#' symbol!"); script_reportsrc(st); + return 1; } + + sd->gmlevel = 99; + is_atcommand(0, sd, cmd, 0); return 0; } |