From 5263eb4e6c3faedaaa2e7be50e6fefe56729705f Mon Sep 17 00:00:00 2001 From: sketchyphoenix Date: Thu, 15 Jan 2009 12:31:10 +0000 Subject: 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 --- src/map/atcommand.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map/atcommand.c') 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); -- cgit v1.2.3-70-g09d2