Skip to content

Commit

Permalink
Summary/Itemsets
Browse files Browse the repository at this point in the history
 * fixed set bonus calculation when using multiple sets in one summary

Localization
 * create more concise error messages when accessing nonexistant locale strings
  • Loading branch information
Sarjuuk committed Jun 6, 2020
1 parent 321f28d commit 240024f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions localization/lang.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
4 changes: 1 addition & 3 deletions setup/tools/filegen/itemsets.func.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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];
Expand Down
1 change: 1 addition & 0 deletions setup/updates/1591451737_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE aowow_dbversion SET `build` = CONCAT(IFNULL(`build`, ''), ' itemsets');

0 comments on commit 240024f

Please sign in to comment.