Core/Conditions

* minor rework
 * fixed columns of tab item loot
 * fixed lookup of classes/races (as they are the only type used as bitmask)
 * implemented reverse lookups everywhere (arguably class, race and skill are too spammy)
 * reverse lookups no longer contain redundant data
 * changed how the groupKey is set, so there are no more cases that can't be looked up
 * fixes #273

 * title: added tab 'criteria-of'
This commit is contained in:
Sarjuuk
2024-07-06 03:37:05 +02:00
parent 0f6b8015a1
commit be7a84a651
16 changed files with 193 additions and 86 deletions

View File

@@ -246,8 +246,7 @@ class Loot
continue;
}
$cndKey = $lootId . ':' . (-1 * ($set['reference'] ?? -$set['content']));
$loot[$cndKey] = $set;
$loot[] = $set;
}
foreach (array_keys($nGroupEquals) as $k)
@@ -264,10 +263,10 @@ class Loot
$groupChances[$k] = (100 - $sum) / ($nGroupEquals[$k] ?: 1);
}
if ($cnd->getBySourceGroup($lootId, Conditions::lootTableToConditionSource($tableName)))
if ($cnd->getBySourceGroup($lootId, Conditions::lootTableToConditionSource($tableName))->prepare())
{
self::storeJSGlobals($cnd->getJsGlobals());
$cnd->toListviewColumn($loot, $this->extraCols);
$cnd->toListviewColumn($loot, $this->extraCols, $lootId, 'content');
}
return [$loot, array_unique($rawItems)];