浏览代码

* Fixed quest saving checking only the first 3 objectives for changes regardless of MAX_QUEST_OBJECTIVES (follow up to r14800, since r13973).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14924 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 年之前
父节点
当前提交
bb9d066877
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 2 0
      Changelog-Trunk.txt
  2. 3 2
      src/char_sql/int_quest.c

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/07/31
+	* Fixed quest saving checking only the first 3 objectives for changes regardless of MAX_QUEST_OBJECTIVES (follow up to r14800, since r13973). [Ai4rei]
 2011/07/22
 	* CMake: Added options BUILD_TXT_SERVERS, BUILD_SQL_SERVERS, BUILD_MAPCACHE. [FlavioJS]
 2011/07/21

+ 3 - 2
src/char_sql/int_quest.c

@@ -91,7 +91,7 @@ bool mapif_quest_update(int char_id, struct quest qd)
 //Save quests
 int mapif_parse_quest_save(int fd)
 {
-	int i, j, num2, num1 = (RFIFOW(fd,2)-8)/sizeof(struct quest);
+	int i, j, k, num2, num1 = (RFIFOW(fd,2)-8)/sizeof(struct quest);
 	int char_id = RFIFOL(fd,4);
 	struct quest qd1[MAX_QUEST_DB],qd2[MAX_QUEST_DB];
 	bool success = true;
@@ -106,7 +106,8 @@ int mapif_parse_quest_save(int fd)
 		ARR_FIND( 0, num2, j, qd1[i].quest_id == qd2[j].quest_id );
 		if( j < num2 ) // Update existed quests
 		{	// Only states and counts are changable.
-			if( qd1[i].state != qd2[j].state || qd1[i].count[0] != qd2[j].count[0] || qd1[i].count[1] != qd2[j].count[1] || qd1[i].count[2] != qd2[j].count[2] )
+			ARR_FIND( 0, MAX_QUEST_OBJECTIVES, k, qd1[i].count[k] != qd2[j].count[k] );
+			if( k != MAX_QUEST_OBJECTIVES || qd1[i].state != qd2[j].state )
 				success &= mapif_quest_update(char_id, qd1[i]);
 
 			if( j < (--num2) )