summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 12:55:00 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-07 12:55:00 +0000
commit322bbe35455b4c423ca8a1ff695a2c68808f5be9 (patch)
tree139a1df58651e64020d0bf05ef4f999614a4996b /src
parentb4ffebc9d89208acff34c35793b918e972005baa (diff)
downloadhercules-322bbe35455b4c423ca8a1ff695a2c68808f5be9.tar.gz
hercules-322bbe35455b4c423ca8a1ff695a2c68808f5be9.tar.bz2
hercules-322bbe35455b4c423ca8a1ff695a2c68808f5be9.tar.xz
hercules-322bbe35455b4c423ca8a1ff695a2c68808f5be9.zip
Fixed npc commands atcommand & charcommand not working with a custom command_symbol
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9431 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/atcommand.h2
-rw-r--r--src/map/charcommand.c6
-rw-r--r--src/map/charcommand.h2
-rw-r--r--src/map/script.c16
5 files changed, 16 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 8e1fec75c..85fdad341 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -42,7 +42,7 @@
#include "mail.h"
#endif
-static char command_symbol = '@'; // first char of the commands (by [Yor])
+char atcommand_symbol = '@'; // first char of the commands (by [Yor])
char *msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
@@ -875,7 +875,7 @@ AtCommandType atcommand(struct map_session_data* sd, const int level, const char
if(p[0] == '|')
p += 3;
- if (*p == command_symbol) { // check first char, try to skip |00 (or something else) [Lance]
+ if (*p == atcommand_symbol) { // check first char, try to skip |00 (or something else) [Lance]
char command[101];
int i = 0;
malloc_set(info, 0, sizeof(AtCommandInfo));
@@ -1008,7 +1008,7 @@ int atcommand_config_read(const char *cfgName) {
w2[0] != '%' && // symbol of party chat speaking
w2[0] != '$' && // symbol of guild chat
w2[0] != '#') // symbol of charcommand
- command_symbol = w2[0];
+ atcommand_symbol = w2[0];
}
fclose(fp);
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index f3be9b0a0..4bb08b217 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -327,7 +327,7 @@ void do_final_msg(void);
char *estr_lower(char *str);
int e_mail_check(char *email);
-
+extern char atcommand_symbol;
#define MAX_MSG 1000
extern char *msg_table[MAX_MSG];
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 32290d8fd..de8668828 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -28,7 +28,7 @@
#include "charcommand.h"
#include "atcommand.h"
-static char command_symbol = '#';
+char charcommand_symbol = '#';
extern char *msg_table[1000]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
@@ -216,7 +216,7 @@ CharCommandType charcommand(struct map_session_data* sd, const int level, const
if(p[0] == '|')
p += 3;
- if (*p == command_symbol) { // check first char, try to skip |00 (or something else) [Lance]
+ if (*p == charcommand_symbol) { // check first char, try to skip |00 (or something else) [Lance]
char command[101];
int i = 0;
malloc_set(info, 0, sizeof(CharCommandInfo));
@@ -299,7 +299,7 @@ int charcommand_config_read(const char *cfgName) {
w2[0] != '%' && // symbol of party chat speaking
w2[0] != '$' && // symbol of guild chat speaking
w2[0] != '@') // symbol of atcommand
- command_symbol = w2[0];
+ charcommand_symbol = w2[0];
}
fclose(fp);
diff --git a/src/map/charcommand.h b/src/map/charcommand.h
index 54215257e..05f02b774 100644
--- a/src/map/charcommand.h
+++ b/src/map/charcommand.h
@@ -69,6 +69,6 @@ CharCommandType charcommand(
int get_charcommand_level(const CharCommandType type);
int charcommand_config_read(const char *cfgName);
-
+extern char charcommand_symbol;
#endif
diff --git a/src/map/script.c b/src/map/script.c
index 36094bfb9..eb9abb8a3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10131,9 +10131,9 @@ int buildin_atcommand(struct script_state *st)
sd = script_rid2sd(st);
if (sd){
- if(cmd[0] != '@'){
+ if(cmd[0] != atcommand_symbol){
cmd += strlen(sd->status.name);
- while(*cmd != '@' && *cmd != 0)
+ while(*cmd != atcommand_symbol && *cmd != 0)
cmd++;
}
atcommand_sub(sd->fd, sd, cmd, 99);
@@ -10147,9 +10147,9 @@ int buildin_atcommand(struct script_state *st)
if (bl->type == BL_NPC)
strncpy(dummy_sd.status.name, ((TBL_NPC*)bl)->name, NAME_LENGTH);
}
- if(cmd[0] != '@'){
+ if(cmd[0] != atcommand_symbol){
cmd += strlen(dummy_sd.status.name);
- while(*cmd != '@' && *cmd != 0)
+ while(*cmd != atcommand_symbol && *cmd != 0)
cmd++;
}
atcommand_sub(0, &dummy_sd, cmd, 99);
@@ -10169,9 +10169,9 @@ int buildin_charcommand(struct script_state *st)
sd = script_rid2sd(st);
if (sd){
- if(cmd[0] != '#'){
+ if(cmd[0] != charcommand_symbol){
cmd += strlen(sd->status.name);
- while(*cmd != '#' && *cmd != 0)
+ while(*cmd != charcommand_symbol && *cmd != 0)
cmd++;
}
charcommand_sub(sd->fd, sd, cmd,99);
@@ -10185,9 +10185,9 @@ int buildin_charcommand(struct script_state *st)
if (bl->type == BL_NPC)
strncpy(dummy_sd.status.name, ((TBL_NPC*)bl)->name, NAME_LENGTH);
}
- if(cmd[0] != '#'){
+ if(cmd[0] != charcommand_symbol){
cmd += strlen(dummy_sd.status.name);
- while(*cmd != '#' && *cmd != 0)
+ while(*cmd != charcommand_symbol && *cmd != 0)
cmd++;
}
charcommand_sub(0, &dummy_sd, cmd, 99);