summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt6
-rw-r--r--doc/script_commands.txt6
-rw-r--r--src/map/atcommand.c10
3 files changed, 18 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 357dac03c..4e5bb8b50 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,9 +3,15 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2009/01/15
+ * Updated script_commands.txt with the book reading command. [SketchyPhoenix]
+ * Added/reworded/removed comments out of r13450
2009/01/14
* Added client login packets 0x01fa and 0x027c. [FlavioJS]
* Other minor cleanups.
+ * #commands used by nonGM players now appear in the chat like normal rather
+ than being processed and ultimately failed, printing out failed command messages
+ that should be visible to only GMs.
2009/01/13
* Cleaned up command @users/#users: [FlavioJS]
- displays everything on the target user (self for @users)
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index a26e16ea9..1c3b26799 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -6202,5 +6202,11 @@ this one update client part too to avoid the glith problem.
---------------------------------------
+*readbook <book id>,<page>;
+
+This will open a book item at the specified page
+
+---------------------------------------
+
Whew.
That's about all of them.
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);