diff --git a/includes/defines.php b/includes/defines.php index 6872e93e..539b7dc8 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -264,6 +264,8 @@ define('GUIDE_STATUS_APPROVED', 3); define('GUIDE_STATUS_REJECTED', 4); define('GUIDE_STATUS_ARCHIVED', 5); +define('DEFAULT_ICON', 'inv_misc_questionmark'); + /* * Game */ diff --git a/includes/types/currency.class.php b/includes/types/currency.class.php index dad04c36..e289a845 100644 --- a/includes/types/currency.class.php +++ b/includes/types/currency.class.php @@ -21,8 +21,7 @@ class CurrencyList extends BaseType parent::__construct($conditions); foreach ($this->iterate() as &$_curTpl) - if (!$_curTpl['iconString']) - $_curTpl['iconString'] = 'inv_misc_questionmark'; + $_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON; } diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 8699c01d..bf5b4fe1 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -45,6 +45,9 @@ class ItemList extends BaseType if ($_curTpl['scalingStatDistribution'] > 0 && $_curTpl['scalingStatValue'] > 0) $this->initScalingStats(); + // fix missing icons + $_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON; + $this->initJsonStats(); if ($miscData) diff --git a/includes/types/skill.class.php b/includes/types/skill.class.php index 101dfda0..9df43246 100644 --- a/includes/types/skill.class.php +++ b/includes/types/skill.class.php @@ -34,7 +34,7 @@ class SkillList extends BaseType } if (!$_curTpl['iconId']) - $_curTpl['iconString'] = 'inv_misc_questionmark'; + $_curTpl['iconString'] = DEFAULT_ICON; } } diff --git a/includes/types/spell.class.php b/includes/types/spell.class.php index aa91315f..a536cee0 100644 --- a/includes/types/spell.class.php +++ b/includes/types/spell.class.php @@ -171,8 +171,8 @@ class SpellList extends BaseType unset($_curTpl['skillLine1']); unset($_curTpl['skillLine2OrMask']); - if (!$_curTpl['iconString']) - $_curTpl['iconString'] = 'inv_misc_questionmark'; + // fix missing icons + $_curTpl['iconString'] = $_curTpl['iconString'] ?: DEFAULT_ICON; $this->scaling[$this->id] = false; } diff --git a/setup/tools/filegen/enchants.func.php b/setup/tools/filegen/enchants.func.php index 951a2ce7..787e8f79 100644 --- a/setup/tools/filegen/enchants.func.php +++ b/setup/tools/filegen/enchants.func.php @@ -65,7 +65,7 @@ if (!CLI) effect1MiscValue, equippedItemClass, equippedItemInventoryTypeMask, equippedItemSubClassMask, skillLine1, - IFNULL(i.name, "inv_misc_questionmark") AS iconString, + IFNULL(i.name, ?) AS iconString, name_loc0, name_loc2, name_loc3, name_loc4, name_loc6, name_loc8 FROM ?_spell s @@ -74,7 +74,7 @@ if (!CLI) WHERE effect1Id = ?d AND name_loc0 NOT LIKE "QA%"' - , 53); // enchantItemPermanent && !qualityAssurance + ,DEFAULT_ICON, SPELL_EFFECT_ENCHANT_ITEM); // check directory-structure foreach (Util::$localeStrings as $dir)