summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGepard <Gepard@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-20 03:06:40 +0000
committerGepard <Gepard@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-20 03:06:40 +0000
commitcb35df2c8b78db0abc5cb45bcad151ed8cffc0eb (patch)
tree0ce60e84cdce007c4531a9f1e7cb302e1677a080
parentf7847c3fd035db1dbd0bcabfb05c9d9d469767ad (diff)
downloadhercules-cb35df2c8b78db0abc5cb45bcad151ed8cffc0eb.tar.gz
hercules-cb35df2c8b78db0abc5cb45bcad151ed8cffc0eb.tar.bz2
hercules-cb35df2c8b78db0abc5cb45bcad151ed8cffc0eb.tar.xz
hercules-cb35df2c8b78db0abc5cb45bcad151ed8cffc0eb.zip
* Fixed quest_check checking exactly 3 quest objectives instead of MAX_QUEST_OBJECTIVES (since r13959).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14800 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/quest.c20
2 files changed, 10 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 1bbd73c5d..366025bef 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,7 @@
Date Added
+2011/04/20
+ * Fixed quest_check checking exactly 3 quest objectives instead of MAX_QUEST_OBJECTIVES (since r13959). [Gepard]
2011/04/17
* Updated packet for the view players' equip feature for 2010-11-24aRagexeRE+ and made it support robes (follow up to r14797). [Ai4rei]
- Fixed spawn/walking packets using wrong variable for shifting buffer reference (since r14797).
diff --git a/src/map/quest.c b/src/map/quest.c
index 3e43fcda6..4960d8a93 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -279,17 +279,13 @@ int quest_check(TBL_PC * sd, int quest_id, quest_check_type type)
return (sd->quest_log[i].time < (unsigned int)time(NULL) ? 2 : sd->quest_log[i].state == Q_COMPLETE ? 1 : 0);
case HUNTING:
{
- int j = sd->quest_index[i];
-
- if( sd->quest_log[i].count[0] < quest_db[j].count[0] || sd->quest_log[i].count[1] < quest_db[j].count[1] || sd->quest_log[i].count[2] < quest_db[j].count[2] )
- {
- if( sd->quest_log[i].time < (unsigned int)time(NULL) )
- return 1;
-
- return 0;
- }
-
- return 2;
+ int j;
+ ARR_FIND(0, MAX_QUEST_OBJECTIVES, j, sd->quest_log[i].count[j] < quest_db[sd->quest_index[i]].count[j]);
+ if( j == MAX_QUEST_OBJECTIVES )
+ return 2;
+ if( sd->quest_log[i].time < (unsigned int)time(NULL) )
+ return 1;
+ return 0;
}
default:
ShowError("quest_check_quest: Unknown parameter %d",type);
@@ -334,7 +330,7 @@ int quest_read_db(void)
continue;
else
{
- ShowError("quest_read_db: insufficient columes in line %s\n", line);
+ ShowError("quest_read_db: insufficient columns in line %s\n", line);
continue;
}
}