Fix if highscores_vocation box is disabled causing Choose a vocation dropdown to fail

This commit is contained in:
slawkens 2024-11-12 20:42:06 +01:00
parent 749e8e6f02
commit ddced132cf

View File

@ -31,12 +31,11 @@ if(!is_numeric($page) || $page < 1 || $page > PHP_INT_MAX) {
$query = Player::query();
$settingHighscoresVocationBox = setting('core.highscores_vocation_box');
$configVocations = config('vocations');
$configVocationsAmount = config('vocations_amount');
$vocationId = null;
if($settingHighscoresVocationBox && $vocation !== 'all') {
if($vocation !== 'all') {
foreach($configVocations as $id => $name) {
if(strtolower($name) == $vocation) {
$vocationId = $id;