diff --git a/pages/search.php b/pages/search.php index bf3d1105..b52ebc8d 100644 --- a/pages/search.php +++ b/pages/search.php @@ -629,10 +629,24 @@ class SearchPage extends GenericPage if ($this->searchMask & SEARCH_TYPE_REGULAR) $this->extendGlobalData($abilities->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $vis = ['level', 'singleclass', 'schools']; + $multiClass = 0; + foreach ($data as $d) + { + $multiClass = 0; + for ($i = 1; $i <= 10; $i++) + if ($d['reqclass'] & (1 << ($i - 1))) + $multiClass++; + + if ($multiClass > 1) + break; + } + + $vis = ['level', 'schools']; if ($abilities->hasSetFields(['reagent1'])) $vis[] = 'reagents'; + $vis[] = $multiClass > 1 ? 'classes' : 'singleclass'; + $osInfo = [TYPE_SPELL, ' (Ability)', $abilities->getMatches(), [], []]; $result = array( 'data' => array_values($data),