summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2018-09-18 12:47:21 +0100
committerAsheraf <acheraf1998@gmail.com>2018-09-18 12:48:55 +0100
commit41ca3c7cc304cac90ae4df32217bd3237e035773 (patch)
tree7ae14512381761c3addc9b6b12369a1dcaad9abc /src/map
parent611bda248b3cb221bef4ad81f74c0508a76095d9 (diff)
downloadhercules-41ca3c7cc304cac90ae4df32217bd3237e035773.tar.gz
hercules-41ca3c7cc304cac90ae4df32217bd3237e035773.tar.bz2
hercules-41ca3c7cc304cac90ae4df32217bd3237e035773.tar.xz
hercules-41ca3c7cc304cac90ae4df32217bd3237e035773.zip
Fix wrong validation for quests in setquestinfo
Diffstat (limited to 'src/map')
-rw-r--r--src/map/quest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/quest.c b/src/map/quest.c
index ab0b06974..8cde4538e 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -887,7 +887,14 @@ static bool quest_questinfo_validate_quests(struct map_session_data *sd, struct
for (i = 0; i < VECTOR_LENGTH(qi->quest_requirement); i++) {
struct questinfo_qreq *quest_requirement = &VECTOR_INDEX(qi->quest_requirement, i);
- if (quest->check(sd, quest_requirement->id, HAVEQUEST) != quest_requirement->state)
+ int quest_progress = quest->check(sd, quest_requirement->id, HAVEQUEST);
+ if (quest_progress == -1)
+ quest_progress = 0;
+ else if (quest_progress == 0 || quest_progress == 1)
+ quest_progress = 1;
+ else
+ quest_progress = 2;
+ if (quest_progress != quest_requirement->state)
return false;
}