From 41ca3c7cc304cac90ae4df32217bd3237e035773 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 18 Sep 2018 12:47:21 +0100 Subject: Fix wrong validation for quests in setquestinfo --- src/map/quest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/map') 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; } -- cgit v1.2.3-70-g09d2