Misc/Fixup

* fix fetching areatriggers from DB and calculating found matches
 * fix Lang concatenating an array of strings with len < 2
 * don't show debug-id col in picker windows (Summary/Profiler) and sort them by score if able
This commit is contained in:
Sarjuuk 2025-08-04 19:30:10 +02:00
parent 569c9efca4
commit 08f0ae711e
4 changed files with 8 additions and 5 deletions

View file

@ -17,8 +17,8 @@ class AreaTriggerList extends BaseType
protected $queryBase = 'SELECT a.*, a.id AS ARRAY_KEY FROM ?_areatrigger a';
protected $queryOpts = array(
'a' => [['s']],
's' => ['j' => ['?_spawns s ON s.type = 503 AND s.typeId = a.id', true], 's' => ', s.areaId']
'a' => [['s']], // guid < 0 are teleporter targets, so exclude them here
's' => ['j' => ['?_spawns s ON s.`type` = 503 AND s.`typeId` = a.`id` AND s.`guid` > 0', true], 's' => ', GROUP_CONCAT(s.`areaId`) AS "areaId"', 'g' => 'a.`id`']
);
public function __construct(array $conditions = [], array $miscData = [])
@ -43,7 +43,7 @@ class AreaTriggerList extends BaseType
);
if ($_ = $this->curTpl['areaId'])
$data[$this->id]['location'] = [$_];
$data[$this->id]['location'] = explode(',', $_);
}
return $data;

View file

@ -128,6 +128,9 @@ class Lang
reset($args);
if (count($args) < 2)
return $callback(current($args), key($args));
do
{
$item = $callback(current($args), key($args));

View file

@ -2425,7 +2425,7 @@ Summary.prototype = {
this.currentScale = $('option:selected', this.sortWeighted)[0].scale;
}
lv.setSort([1], true, false);
lv.setSort(this.currentScale ? [4] : [1], true, false);
lv.setData(this.calcScores(lv.data, this.currentScale));
if (this.currentScale) {

View file

@ -5341,7 +5341,7 @@ function Listview(opt) {
this.sort = [];
}
if (this.debug || g_user.debug) {
if (this.debug) {
this.columns.splice(0, 0, {
id: 'debug-id',
compute: function(data, td) {