From 240024fb101a7edb2528cf753bab5d3c68f41898 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 6 Jun 2020 15:52:27 +0200 Subject: [PATCH] Summary/Itemsets * fixed set bonus calculation when using multiple sets in one summary Localization * create more concise error messages when accessing nonexistant locale strings --- localization/lang.class.php | 8 ++++++-- setup/tools/filegen/itemsets.func.php | 4 +--- setup/updates/1591451737_01.sql | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 setup/updates/1591451737_01.sql diff --git a/localization/lang.class.php b/localization/lang.class.php index 1857cbde8..3c428e48a 100644 --- a/localization/lang.class.php +++ b/localization/lang.class.php @@ -66,7 +66,9 @@ public static function __callStatic($prop, $args) { if (!isset(self::$$prop)) { - trigger_error('Lang - tried to use undefined property Lang::$'.$prop, E_USER_WARNING); + $dbt = debug_backtrace()[0]; + $file = explode(DIRECTORY_SEPARATOR, $dbt['file']); + trigger_error('Lang - tried to use undefined property Lang::$'.$prop.', called in '.array_pop($file).':'.$dbt['line'], E_USER_WARNING); return null; } @@ -82,7 +84,9 @@ public static function __callStatic($prop, $args) } else if (!isset($var[$arg])) { - trigger_error('Lang - undefined key "'.$arg.'" in property Lang::$'.$prop.'[\''.implode('\'][\'', $args).'\']', E_USER_WARNING); + $dbt = debug_backtrace()[0]; + $file = explode(DIRECTORY_SEPARATOR, $dbt['file']); + trigger_error('Lang - undefined property Lang::$'.$prop.'[\''.implode('\'][\'', $args).'\'], called in '.array_pop($file).':'.$dbt['line'], E_USER_WARNING); return null; } diff --git a/setup/tools/filegen/itemsets.func.php b/setup/tools/filegen/itemsets.func.php index e73ff3791..cb5d64fb5 100644 --- a/setup/tools/filegen/itemsets.func.php +++ b/setup/tools/filegen/itemsets.func.php @@ -54,6 +54,7 @@ function itemsets() $setOut = array( 'id' => $set['id'], + 'idbak' => $set['refSetId'], 'name' => (7 - $set['quality']).Util::jsEscape(Util::localizedString($set, 'name')), 'pieces' => [], 'heroic' => !!$set['heroic'], // should be bool @@ -76,9 +77,6 @@ function itemsets() if ($set['contentGroup']) $setOut['note'] = $set['contentGroup']; - if ($set['id'] < 0) - $setOut['idbak'] = $set['refSetId']; - for ($i = 1; $i < 11; $i++) if ($set['item'.$i]) $setOut['pieces'][] = $set['item'.$i]; diff --git a/setup/updates/1591451737_01.sql b/setup/updates/1591451737_01.sql new file mode 100644 index 000000000..82d87a5b4 --- /dev/null +++ b/setup/updates/1591451737_01.sql @@ -0,0 +1 @@ +UPDATE aowow_dbversion SET `build` = CONCAT(IFNULL(`build`, ''), ' itemsets');