diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 8 | ||||
-rw-r--r-- | src/map/script.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 241914528..52bd467ec 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9794,7 +9794,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) struct npc_data* npc; if ((npc = npc_name2id(str))) { - char split_data[10][50]; + char split_data[NUM_WHISPER_VAR][CHAT_SIZE_MAX]; char *split; char output[256]; @@ -9802,13 +9802,13 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) // skip codepage indicator, if detected if( str[0] == '|' && strlen(str) >= 4 ) str += 3; - for( i = 0; i < 10; ++i ) + for( i = 0; i < NUM_WHISPER_VAR; ++i ) {// Splits the message using '#' as separators split = strchr(str,'#'); if( split == NULL ) { // use the remaining string safestrncpy(split_data[i], str, ARRAYLENGTH(split_data[i])); - for( ++i; i < 10; ++i ) + for( ++i; i < NUM_WHISPER_VAR; ++i ) split_data[i][0] = '\0'; break; } @@ -9817,7 +9817,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) str = split+1; } - for( i = 0; i < 10; ++i ) + for( i = 0; i < NUM_WHISPER_VAR; ++i ) { sprintf(output, "@whispervar%d$", i); set_var(sd,output,(char *) split_data[i]); diff --git a/src/map/script.h b/src/map/script.h index 9de1285b8..4815a438d 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -4,6 +4,8 @@ #ifndef _SCRIPT_H_ #define _SCRIPT_H_ +#define NUM_WHISPER_VAR 10 + struct map_session_data; extern int potion_flag; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex] |