mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
* fixed bitshift by negative number issue when evaluating spell MiscValues
* defined upper limit for localeIds and also discard negative localeIds * fixed eval error when parsing spell descriptions. Calculated numbers sadly can't be localized.
This commit is contained in:
@@ -324,6 +324,7 @@ define('PROFILER_CU_NEEDS_RESYNC', 0x10);
|
||||
|
||||
define('MAX_LEVEL', 80);
|
||||
define('MAX_SKILL', 450);
|
||||
define('MAX_LOCALES', 16); // technical limitation, 6 in use here
|
||||
define('WOW_BUILD', 12340);
|
||||
|
||||
// Loot handles
|
||||
|
||||
@@ -253,7 +253,8 @@ if (!CLI)
|
||||
// all strings attached..
|
||||
if (!empty($AoWoWconf['aowow']))
|
||||
{
|
||||
if (isset($_GET['locale']) && (CFG_LOCALES & (1 << (int)$_GET['locale'])))
|
||||
if (isset($_GET['locale']) && (int)$_GET['locale'] <= MAX_LOCALES && (int)$_GET['locale'] >= 0)
|
||||
if (CFG_LOCALES & (1 << $_GET['locale']))
|
||||
User::useLocale($_GET['locale']);
|
||||
|
||||
Lang::load(User::$localeString);
|
||||
|
||||
@@ -1440,7 +1440,7 @@ class SpellList extends BaseType
|
||||
// step 3: try to evaluate result
|
||||
$evaled = $this->resolveEvaluation($str);
|
||||
|
||||
$return = is_numeric($evaled) ? Lang::nf($evaled, $precision, true) : $evaled;
|
||||
$return = is_numeric($evaled) ? round($evaled, $precision) : $evaled;
|
||||
|
||||
return [$return, $fSuffix, $fRating];
|
||||
}
|
||||
|
||||
@@ -1906,7 +1906,7 @@ class SpellPage extends GenericPage
|
||||
case 212: // Mod Ranged Attack Power Of Stat Percent
|
||||
case 219: // Mod Mana Regeneration from Stat
|
||||
case 268: // Mod Attack Power Of Stat Percent
|
||||
$mask = $effMV == -1 ? 0x1F : 1 << $effMV;
|
||||
$mask = $effMV < 0 ? 0x1F : 1 << $effMV;
|
||||
$_ = [];
|
||||
for ($j = 0; $j < 5; $j++)
|
||||
if ($mask & (1 << $j))
|
||||
|
||||
Reference in New Issue
Block a user