From 33a1a45a636b0d2df4da5cf2950933718bb4891c Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 6 May 2017 22:17:18 +0200 Subject: [PATCH] Misc/Notices * fixed display of GemConditions on enchantment detail page * correctly initialize class and race masks for items --- README.md | 2 +- includes/types/item.class.php | 10 ++++++---- pages/enchantment.php | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5e77b554..d3015b13 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ audio processing may require [lame](https://sourceforge.net/projects/lame/files/ > \/Interface/PvPRankBadges > \/Interface/FlavorImages > \/Interface/Calendar/Holidays/ - > \/Sounds/ + > \/Sound/ .. optionaly (for other uses): > \/Interface/GLUES/LOADINGSCREENS/ diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 0369498c..00f5d969 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -51,13 +51,15 @@ class ItemList extends BaseType $this->json[$this->id]['itemset'] = $miscData['pcsToSet'][$this->id]; // unify those pesky masks - $_ = &$_curTpl['requiredClass']; - if ($_ < 0 || ($_ & CLASS_MASK_ALL) == CLASS_MASK_ALL) + $_ = &$_curTpl['requiredClass']; + $_ &= CLASS_MASK_ALL; + if ($_ < 0 || $_ == CLASS_MASK_ALL) $_ = 0; unset($_); $_ = &$_curTpl['requiredRace']; - if ($_ < 0 || ($_ & RACE_MASK_ALL) == RACE_MASK_ALL) + $_ &= RACE_MASK_ALL; + if ($_ < 0 || $_ == RACE_MASK_ALL) $_ = 0; unset($_); @@ -1917,7 +1919,7 @@ class ItemListFilter extends Filter public function createConditionsForWeights() { - if (!$this->fiData['v']['wt']) + if (empty($this->fiData['v']['wt'])) return null; $this->wtCnd = []; diff --git a/pages/enchantment.php b/pages/enchantment.php index f1b3739c..6dcf65f0 100644 --- a/pages/enchantment.php +++ b/pages/enchantment.php @@ -151,19 +151,19 @@ class EnchantmentPage extends GenericPage return $foo; }; - $bLink = $gemCnd['color'.$i] ? ''.Lang::item('gemColors', $gemCnd['color'.$i] - 1).'' : ''; - $cLink = $gemCnd['cmpColor'.$i] ? ''.Lang::item('gemColors', $gemCnd['cmpColor'.$i] - 1).'' : ''; + $bLink = $gemCnd['color'.$i] ? ''.Lang::item('gemColors', $gemCnd['color'.$i] - 1).'' : ''; + $cLink = $gemCnd['cmpColor'.$i] ? ''.Lang::item('gemColors', $gemCnd['cmpColor'.$i] - 1).'' : ''; switch ($gemCnd['comparator'.$i]) { case 2: // requires less than ( || ) gems case 5: // requires at least than ( || ) gems $sp = (int)$gemCnd['value'.$i] > 1; - $x .= ''.Lang::achievement('reqNumCrt').' '.sprintf(Lang::item('gemConditions', $gemCnd['comparator'.$i], $sp), $gemCnd['value'.$i], $bLink).'
'; + $x .= ''.Lang::achievement('reqNumCrt').' '.Lang::item('gemConditions', $gemCnd['comparator'.$i], [$gemCnd['value'.$i], $bLink]).'
'; break; case 3: // requires more than ( || ) gems $link = ''.Lang::item('gemColors', $gemCnd['cmpColor'.$i] - 1).''; - $x .= ''.Lang::achievement('reqNumCrt').' '.sprintf(Lang::item('gemConditions', 3), $bLink, $cLink).'
'; + $x .= ''.Lang::achievement('reqNumCrt').' '.Lang::item('gemConditions', $gemCnd['comparator'.$i], [$bLink, $cLink]).'
'; break; } }