Sfoglia il codice sorgente

added anti-bad-scripting check to quest.c, bugreport:5012

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15147 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 anni fa
parent
commit
72e41ae973
1 ha cambiato i file con 10 aggiunte e 7 eliminazioni
  1. 10 7
      src/map/quest.c

+ 10 - 7
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);