浏览代码

* Fixed crash with upgrading TXT and having more than 256 accounts. [Valaris]
* TXT upgrades will convert broken flag to attribute column. [Valaris]


git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@271 54d463be-8e91-2dee-dedb-b68131a5f0ec

valaris 20 年之前
父节点
当前提交
20416572ab
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. 2 0
      Changelog.txt
  2. 3 3
      src/char/char.c
  3. 2 2
      src/char/int_storage.c

+ 2 - 0
Changelog.txt

@@ -1,5 +1,7 @@
 Date	Added
 11/20
+	* Fixed crash with upgrading TXT and having more than 256 accounts. [Valaris]
+	* TXT upgrades will convert broken flag to attribute column. [Valaris]
 	* Prevent use of emotion packet to display red mute emote. [Valaris]
 	* Initialized "day" variable in npc.c. [Valaris]
 	* Added @whozeny. Shows list of top 50 online players and their zeny sorted from highest to lowest. [Valaris]

+ 3 - 3
src/char/char.c

@@ -479,7 +479,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p) {
 		if (sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		    &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
 		    &tmp_int[4], &tmp_int[5], &tmp_int[6],
-		    &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[11], &len) == 12) {
+		    &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[10], &len) == 12) {
 			// do nothing, it's ok
 		} else if (sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		          &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
@@ -509,7 +509,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p) {
 		if (sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		    &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
 		    &tmp_int[4], &tmp_int[5], &tmp_int[6],
-		    &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[11], &len) == 12) {
+		    &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[10], &len) == 12) {
 			// do nothing, it's ok
 		} else if (sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		           &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
@@ -685,7 +685,7 @@ int mmo_char_init(void) {
 				char_log("Out of memory: mmo_char_init (realloc of char_dat)." RETCODE);
 				exit(1);
 			}
-			online_chars = realloc(online_chars, sizeof(int) * char_max);
+			online_chars = realloc(online_chars, sizeof(struct online_chars) * char_max);
 			if (!online_chars) {
 				printf("Out of memory: mmo_char_init (realloc of online_chars).\n");
 				char_log("Out of memory: mmo_char_init (realloc of online_chars)." RETCODE);

+ 2 - 2
src/char/int_storage.c

@@ -62,7 +62,7 @@ int storage_fromstr(char *str,struct storage *p)
 		if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		      &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
 		      &tmp_int[4], &tmp_int[5], &tmp_int[6],
-		      &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[11], &len) == 12) {
+		      &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[10], &len) == 12) {
 			p->storage[i].id = tmp_int[0];
 			p->storage[i].nameid = tmp_int[1];
 			p->storage[i].amount = tmp_int[2];
@@ -144,7 +144,7 @@ int guild_storage_fromstr(char *str,struct guild_storage *p)
 	if(sscanf(str + next, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d%n",
 		      &tmp_int[0], &tmp_int[1], &tmp_int[2], &tmp_int[3],
 		      &tmp_int[4], &tmp_int[5], &tmp_int[6],
-		      &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[11], &len) == 12) {
+		      &tmp_int[7], &tmp_int[8], &tmp_int[9], &tmp_int[10], &tmp_int[10], &len) == 12) {
 			p->storage[i].id = tmp_int[0];
 			p->storage[i].nameid = tmp_int[1];
 			p->storage[i].amount = tmp_int[2];