summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-16 15:26:27 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-16 15:26:27 +0000
commit1e96fe7d63e6ec25cad98a5b1bef1b81e2c00fb6 (patch)
treec0ae3c85530ad4ea4c6d1e02776427dfb245004a /src/map/atcommand.c
parentb8bec28b62db49329ca30bf5d04b37c40cb147ea (diff)
downloadhercules-1e96fe7d63e6ec25cad98a5b1bef1b81e2c00fb6.tar.gz
hercules-1e96fe7d63e6ec25cad98a5b1bef1b81e2c00fb6.tar.bz2
hercules-1e96fe7d63e6ec25cad98a5b1bef1b81e2c00fb6.tar.xz
hercules-1e96fe7d63e6ec25cad98a5b1bef1b81e2c00fb6.zip
* Edited atcommand and charcommand syntax. Now it doesn't need the useless character name and ":".
modified Changelog-Trunk.txt modified src/map/atcommand.c modified src/map/atcommand.h modified src/map/charcommand.c modified src/map/charcommand.h modified src/map/clif.c modified src/map/map.c modified src/map/script.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9230 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7e641bd1e..213f864d5 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -776,37 +776,13 @@ int get_atcommand_level(const AtCommandType type) {
return 100; // 100: command can not be used
}
-/*==========================================
- *is_atcommand @コマンドに存在するかどうか確認する
- *------------------------------------------
- */
AtCommandType
-is_atcommand(const int fd, struct map_session_data* sd, const char* message, int gmlvl) {
- const char* str = message;
- int s_flag = 0;
+atcommand_sub(const int fd, struct map_session_data* sd, const char* str, int gmlvl) {
AtCommandInfo info;
AtCommandType type;
- nullpo_retr(AtCommand_None, sd);
-
- if (sd->sc.count && sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCOMMAND) {
- return AtCommand_Unknown;
- }
-
- if (!message || !*message)
- return AtCommand_None;
-
malloc_set(&info, 0, sizeof(info));
- str += strlen(sd->status.name);
- while (*str && (isspace(*str) || (s_flag == 0 && *str == ':'))) {
- if (*str == ':')
- s_flag = 1;
- str++;
- }
- if (!*str)
- return AtCommand_None;
- if (!gmlvl) gmlvl = pc_isGM(sd);
type = atcommand(sd, gmlvl, str, &info);
if (type != AtCommand_None) {
char command[100];
@@ -848,6 +824,36 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int
}
/*==========================================
+ *is_atcommand @コマンドに存在するかどうか確認する
+ *------------------------------------------
+ */
+AtCommandType
+is_atcommand(const int fd, struct map_session_data* sd, const char* message) {
+ const char* str = message;
+ int s_flag = 0;
+
+ nullpo_retr(AtCommand_None, sd);
+
+ if (sd->sc.count && sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCOMMAND) {
+ return AtCommand_Unknown;
+ }
+
+ if (!message || !*message)
+ return AtCommand_None;
+
+ str += strlen(sd->status.name);
+ while (*str && (isspace(*str) || (s_flag == 0 && *str == ':'))) {
+ if (*str == ':')
+ s_flag = 1;
+ str++;
+ }
+ if (!*str)
+ return AtCommand_None;
+
+ return atcommand_sub(fd,sd,str,pc_isGM(sd));
+}
+
+/*==========================================
*
*------------------------------------------
*/