Browse Source

* Merged changes up to eAthena 15067.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15481 54d463be-8e91-2dee-dedb-b68131a5f0ec
eathenabot 13 years ago
parent
commit
87f1a4a49e
2 changed files with 6 additions and 4 deletions
  1. 4 4
      src/map/clif.c
  2. 2 0
      src/map/script.h

+ 4 - 4
src/map/clif.c

@@ -9794,7 +9794,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
 		struct npc_data* npc;
 		struct npc_data* npc;
 		if ((npc = npc_name2id(str)))	
 		if ((npc = npc_name2id(str)))	
 		{
 		{
-			char split_data[10][50];
+			char split_data[NUM_WHISPER_VAR][CHAT_SIZE_MAX];
 			char *split;
 			char *split;
 			char output[256];
 			char output[256];
 
 
@@ -9802,13 +9802,13 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
 			// skip codepage indicator, if detected
 			// skip codepage indicator, if detected
 			if( str[0] == '|' && strlen(str) >= 4 )
 			if( str[0] == '|' && strlen(str) >= 4 )
 				str += 3;
 				str += 3;
-			for( i = 0; i < 10; ++i )
+			for( i = 0; i < NUM_WHISPER_VAR; ++i )
 			{// Splits the message using '#' as separators
 			{// Splits the message using '#' as separators
 				split = strchr(str,'#');
 				split = strchr(str,'#');
 				if( split == NULL )
 				if( split == NULL )
 				{	// use the remaining string
 				{	// use the remaining string
 					safestrncpy(split_data[i], str, ARRAYLENGTH(split_data[i]));
 					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';
 						split_data[i][0] = '\0';
 					break;
 					break;
 				}
 				}
@@ -9817,7 +9817,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
 				str = split+1;
 				str = split+1;
 			}
 			}
 			
 			
-			for( i = 0; i < 10; ++i )
+			for( i = 0; i < NUM_WHISPER_VAR; ++i )
 			{
 			{
 				sprintf(output, "@whispervar%d$", i);
 				sprintf(output, "@whispervar%d$", i);
 				set_var(sd,output,(char *) split_data[i]);
 				set_var(sd,output,(char *) split_data[i]);

+ 2 - 0
src/map/script.h

@@ -4,6 +4,8 @@
 #ifndef _SCRIPT_H_
 #ifndef _SCRIPT_H_
 #define _SCRIPT_H_
 #define _SCRIPT_H_
 
 
+#define NUM_WHISPER_VAR 10
+
 struct map_session_data;
 struct map_session_data;
 
 
 extern int potion_flag; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex]
 extern int potion_flag; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex]