* fixed an translation issue on itemMod <=> statId causing wrong search results
 * fixed an sql-error breaking stat-based searches for items
This commit is contained in:
Sarjuuk
2015-08-17 21:42:14 +02:00
parent 960e48b7aa
commit a7eabb4b9d
3 changed files with 16 additions and 5 deletions

View File

@@ -1825,7 +1825,7 @@ class ItemListFilter extends Filter
if ($select) if ($select)
{ {
$this->extraOpts['is']['s'][] = ', IF(is.id IS NULL, 0, ('.implode(' + ', $select).') / '.$wtSum.') AS score'; $this->extraOpts['is']['s'][] = ', IF(is.typeId IS NULL, 0, ('.implode(' + ', $select).') / '.$wtSum.') AS score';
$this->extraOpts['is']['o'][] = 'score DESC'; $this->extraOpts['is']['o'][] = 'score DESC';
$this->extraOpts['i']['o'][] = null; // remove default ordering $this->extraOpts['i']['o'][] = null; // remove default ordering
} }

View File

@@ -175,11 +175,21 @@ class SpellList extends BaseType
case 29: // ModStat MiscVal:type case 29: // ModStat MiscVal:type
if ($mv < 0) // all stats if ($mv < 0) // all stats
{ {
for ($j = 0; $j < 5; $j++) for ($iMod = ITEM_MOD_AGILITY; $iMod <= ITEM_MOD_STAMINA; $iMod++)
Util::arraySumByKey($stats, [(ITEM_MOD_AGILITY + $j) => $pts]); Util::arraySumByKey($stats, [iMod => $pts]);
} }
else // one stat else if ($mv == STAT_STRENGTH) // one stat
Util::arraySumByKey($stats, [(ITEM_MOD_AGILITY + $mv) => $pts]); Util::arraySumByKey($stats, [ITEM_MOD_STRENGTH => $pts]);
else if ($mv == STAT_AGILITY)
Util::arraySumByKey($stats, [ITEM_MOD_AGILITY => $pts]);
else if ($mv == STAT_STAMINA)
Util::arraySumByKey($stats, [ITEM_MOD_STAMINA => $pts]);
else if ($mv == STAT_INTELLECT)
Util::arraySumByKey($stats, [ITEM_MOD_INTELLECT => $pts]);
else if ($mv == ITEM_MOD_SPIRIT)
Util::arraySumByKey($stats, [ITEM_MOD_SPIRIT => $pts]);
else // one bullshit
trigger_error('AuraId 29 of spell #'.$this->id.' has wrong statId #'.$mv, E_USER_WARNING);
break; break;
case 34: // Increase Health case 34: // Increase Health

View File

@@ -0,0 +1 @@
UPDATE aowow_dbversion SET `sql` = CONCAT(`sql`, ' item_stats');