From 92707807ce344404bebb1cb925cca00490d07f81 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 17 Dec 2011 04:48:50 +0000 Subject: added anti-bad-scripting check to quest.c, bugreport:5012 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15147 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/quest.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/map/quest.c') diff --git a/src/map/quest.c b/src/map/quest.c index 4c890ce9e..6be181eac 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -279,13 +279,16 @@ 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; - 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; + if( sd->quest_log[i].state == 0 || sd->quest_log[i].state == 1 ) { + 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; + } else + return 0; } default: ShowError("quest_check_quest: Unknown parameter %d",type); -- cgit v1.2.3-60-g2f50