From 2f7db3cafdf30acef5bc6473d1ceae7ee103ea34 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 20 May 2017 10:25:50 +0200 Subject: [PATCH] small fix localrecords --- plugins/MCTeam/LocalRecordsPlugin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/MCTeam/LocalRecordsPlugin.php b/plugins/MCTeam/LocalRecordsPlugin.php index 07886f4c..e6d6f31a 100644 --- a/plugins/MCTeam/LocalRecordsPlugin.php +++ b/plugins/MCTeam/LocalRecordsPlugin.php @@ -293,10 +293,12 @@ class LocalRecordsPlugin implements ManialinkPageAnswerListener, CallbackListene //Generate the Records around a player and display below topRecords for ($i = $playerIndex - $recordsBeforeAfter; $i <= $playerIndex + $recordsBeforeAfter; $i++) { - $recordFrame = $this->generateRecordLineFrame($records[$i], $player); - $recordFrame->setY($y); - $listFrame->addChild($recordFrame); - $y -= $lineHeight; + if(array_key_exists($i, $records)){ //If there are no records behind you + $recordFrame = $this->generateRecordLineFrame($records[$i], $player); + $recordFrame->setY($y); + $listFrame->addChild($recordFrame); + $y -= $lineHeight; + } } } else {