summaryrefslogtreecommitdiff
path: root/src/map/quest.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-17 04:48:50 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-17 04:48:50 +0000
commit92707807ce344404bebb1cb925cca00490d07f81 (patch)
tree3cc69647a4ddf059d45a196dfa28ead05535bfec /src/map/quest.c
parent2816c4fd4700af98ad3ff72353d6a60c724f0662 (diff)
downloadhercules-92707807ce344404bebb1cb925cca00490d07f81.tar.gz
hercules-92707807ce344404bebb1cb925cca00490d07f81.tar.bz2
hercules-92707807ce344404bebb1cb925cca00490d07f81.tar.xz
hercules-92707807ce344404bebb1cb925cca00490d07f81.zip
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
Diffstat (limited to 'src/map/quest.c')
-rw-r--r--src/map/quest.c17
1 files changed, 10 insertions, 7 deletions
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);