Quests/Filter
* filter "repeatable" now also considers specialFlags
This commit is contained in:
parent
24d683332d
commit
0e9ca3ff90
1 changed files with 12 additions and 1 deletions
|
|
@ -451,7 +451,7 @@ class QuestListFilter extends Filter
|
|||
25 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
27 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_DAILY ], // daily
|
||||
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
|
||||
33 => [FILTER_CR_ENUM, 'e.holidayId' ], // relatedevent
|
||||
34 => [FILTER_CR_CALLBACK, 'cbAvailable', null, null], // availabletoplayers [yn]
|
||||
|
|
@ -614,6 +614,17 @@ class QuestListFilter extends Filter
|
|||
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)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue