summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-15 12:31:10 +0000
committersketchyphoenix <sketchyphoenix@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-15 12:31:10 +0000
commit5263eb4e6c3faedaaa2e7be50e6fefe56729705f (patch)
treeefafd0f8f44246a9d013fffed0448c9a9826046a /src
parent56fae5b1bc284d5806c256969a807f3bdf1ed5e8 (diff)
downloadhercules-5263eb4e6c3faedaaa2e7be50e6fefe56729705f.tar.gz
hercules-5263eb4e6c3faedaaa2e7be50e6fefe56729705f.tar.bz2
hercules-5263eb4e6c3faedaaa2e7be50e6fefe56729705f.tar.xz
hercules-5263eb4e6c3faedaaa2e7be50e6fefe56729705f.zip
Updated script_commands.txt with the book reading command info.
Added/reworded/removed comments to/in/from r13450 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13451 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index aa979b017..b74e0be87 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8979,7 +8979,6 @@ bool is_atcommand_sub(const int fd, struct map_session_data* sd, const char* str
if( log_config.gm && info->level >= log_config.gm && *str == atcommand_symbol )
log_atcommand(sd, str);
- //
if( log_config.gm && info->level2 >= log_config.gm && *str == charcommand_symbol
&& (ssd = (struct map_session_data *)session[fd]->session_data) != NULL )
log_atcommand(ssd, str);
@@ -9030,14 +9029,14 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if (*message == charcommand_symbol)
{
- if (gmlvl = 0)
+ if (gmlvl == 0)
return false;
//Checks to see if #command has a name or a name + parameters.
x = sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", cmd, charname, param);
y = sscanf(message, "%99s %23s %99[^\n]", cmd, charname2, param2);
- //x being > 1 is unique to its proper syntax
+ //z always has the value of the scan that was successful
z = ( x > 1 ) ? x : y;
if ( (pl_sd = map_nick2sd(charname)) == NULL && ( (pl_sd = map_nick2sd(charname2)) == NULL ) )
@@ -9047,6 +9046,9 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
return true;
}
+ //#command + name means the sufficient target was used and anything else after
+ //can be looked at by the actual command function since most scan to see if the
+ //right parameters are used.
if ( x > 2 ) {
sprintf(message2, "%s %s", cmd, param);
return is_atcommand_sub(fd,pl_sd,message2,gmlvl);
@@ -9057,7 +9059,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
}
//Regardless of what style the #command is used, if it's correct, it will always have
- //this value if there is no parameter.
+ //this value if there is no parameter. Send it as just the #command
if ( z == 2 ) {
sprintf(message2, "%s", cmd);
return is_atcommand_sub(fd,pl_sd,message2,gmlvl);