summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt7
-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
6 files changed, 21 insertions, 18 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 156e58627..c328620ab 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,7 +3,10 @@ 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.
-2004/12/06
+2006/12/07
+ * Fixed npc commands atcommand & charcommand not working with a custom
+ command_symbol [Toms]
+2006/12/06
* Changed the order of view-change packets for SC xmas/wedding, should fix
crashing if you change into xmas suit while in fighting stance. [Skotlex]
* Renamed the mob mode Cast-Sensor Melee to Cast-Sensor idle since these
@@ -31,7 +34,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
* Added StringBuf_Vprintf to utils.c and changed the showmsg.c buffer.
Now it uses a static buffer and a StringBuf when needed (a debug message
indicating the static buffer needs to be increased is shown). [FlavioJS]
-2004/12/05
+2006/12/05
* The can log value now is "reset" when you die allowing you to
respawn/quit instantly after death. [Skotlex]
* Fixed sc data load failing when using charsave_method: 1 [Skotlex]
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);