From 920c8a936f7ab1583bd20358b8cf54ef1c1a4ce2 Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Thu, 4 Jan 2018 00:28:16 +0100 Subject: [PATCH] * some small fix regarding highscores vocation box --- system/pages/highscores.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 74d612fc..bf4c160a 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -22,11 +22,9 @@ $add_sql = ''; $config_vocations = $config['vocations']; if($config['highscores_vocation_box'] && isset($vocation)) { - for($i = 1; $i < count($config_vocations) / 2; $i++) - { - if(strtolower($config_vocations[$i]) == $vocation) - { - $add_sql = 'AND ' . $db->fieldName('vocation') . ' = ' . $db->quote($i); + foreach($config['vocations'] as $id => $name) { + if(strtolower($name) == $vocation) { + $add_sql = 'AND ' . $db->fieldName('vocation') . ' = ' . $db->quote($id); break; } }