Quests/Filter

* filter "repeatable" now also considers specialFlags
This commit is contained in:
Sarjuuk
2023-05-10 20:01:06 +02:00
parent 24d683332d
commit 0e9ca3ff90

View File

@@ -451,7 +451,7 @@ class QuestListFilter extends Filter
25 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments 25 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
27 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_DAILY ], // daily 27 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_DAILY ], // daily
28 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_WEEKLY ], // weekly 28 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_WEEKLY ], // weekly
29 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_REPEATABLE ], // repeatable 29 => [FILTER_CR_CALLBACK, 'cbRepeatable', null ], // repeatable
30 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id 30 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
33 => [FILTER_CR_ENUM, 'e.holidayId' ], // relatedevent 33 => [FILTER_CR_ENUM, 'e.holidayId' ], // relatedevent
34 => [FILTER_CR_CALLBACK, 'cbAvailable', null, null], // availabletoplayers [yn] 34 => [FILTER_CR_CALLBACK, 'cbAvailable', null, null], // availabletoplayers [yn]
@@ -614,6 +614,17 @@ class QuestListFilter extends Filter
return ['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&']; return ['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'];
} }
protected function cbRepeatable($cr)
{
if (!$this->int2Bool($cr[1]))
return false;
if ($cr[1])
return ['OR', ['flags', QUEST_FLAG_REPEATABLE, '&'], ['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE, '&']];
else
return ['AND', [['flags', QUEST_FLAG_REPEATABLE, '&'], 0], [['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE, '&'], 0]];
}
protected function cbItemChoices($cr) protected function cbItemChoices($cr)
{ {
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1])) if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))