Filter/Fixups

* fixed wrong indizes for gem color picker in locale 3 (deDE)
 * fixed interpretation of filter enums. Some are providing their value directly, others have an intermediate key.
 * createSQLForCriterium is no longer abstract. (was implemented in exactly the same way everywhere)
 * erronous criteria are now logged and discarded entirely)
This commit is contained in:
Sarjuuk
2023-08-02 23:29:53 +02:00
parent 837fdf78a0
commit 0f186576d3
16 changed files with 30 additions and 148 deletions

View File

@@ -144,15 +144,11 @@ class GameObjectListFilter extends Filter
protected $enums = array(
1 => parent::ENUM_ZONE,
16 => parent::ENUM_EVENT,
50 => array(
null, 1, 2, 3, 4,
663 => 663,
883 => 883
)
50 => [1, 2, 3, 4, 663, 883]
);
protected $genericFilter = array(
1 => [FILTER_CR_ENUM, 's.areaId' ], // foundin
1 => [FILTER_CR_ENUM, 's.areaId', false, true], // foundin
2 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'startsQuests', 0x1 ], // startsquest [side]
3 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'endsQuests', 0x2 ], // endsquest [side]
4 => [FILTER_CR_CALLBACK, 'cbOpenable', null, null], // openable [yn]
@@ -174,17 +170,6 @@ class GameObjectListFilter extends Filter
'ma' => [FILTER_V_EQUAL, 1, false] // match any / all filter
);
protected function createSQLForCriterium(&$cr)
{
if (in_array($cr[0], array_keys($this->genericFilter)))
if ($genCR = $this->genericCriterion($cr))
return $genCR;
unset($cr);
$this->error = true;
return [1];
}
protected function createSQLForValues()
{
$parts = [];