summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-31 08:34:51 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-31 08:34:51 +0000
commit854bdc928d3b12514bf133f85af483a4dc44a8cd (patch)
tree495593ada228f961adc4bdc98b346e79c77fc832 /src/char_sql
parenta751e7ba146eee3694169b8087306c93732689e6 (diff)
downloadhercules-854bdc928d3b12514bf133f85af483a4dc44a8cd.tar.gz
hercules-854bdc928d3b12514bf133f85af483a4dc44a8cd.tar.bz2
hercules-854bdc928d3b12514bf133f85af483a4dc44a8cd.tar.xz
hercules-854bdc928d3b12514bf133f85af483a4dc44a8cd.zip
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14924 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/int_quest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/char_sql/int_quest.c b/src/char_sql/int_quest.c
index dd5b915a4..224205412 100644
--- a/src/char_sql/int_quest.c
+++ b/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) )