small fix localrecords

This commit is contained in:
kremsy 2017-05-20 10:25:50 +02:00
parent 8cfe46e32f
commit 2f7db3cafd

View File

@ -293,11 +293,13 @@ class LocalRecordsPlugin implements ManialinkPageAnswerListener, CallbackListene
//Generate the Records around a player and display below topRecords //Generate the Records around a player and display below topRecords
for ($i = $playerIndex - $recordsBeforeAfter; $i <= $playerIndex + $recordsBeforeAfter; $i++) { for ($i = $playerIndex - $recordsBeforeAfter; $i <= $playerIndex + $recordsBeforeAfter; $i++) {
if(array_key_exists($i, $records)){ //If there are no records behind you
$recordFrame = $this->generateRecordLineFrame($records[$i], $player); $recordFrame = $this->generateRecordLineFrame($records[$i], $player);
$recordFrame->setY($y); $recordFrame->setY($y);
$listFrame->addChild($recordFrame); $listFrame->addChild($recordFrame);
$y -= $lineHeight; $y -= $lineHeight;
} }
}
} else { } else {
$listFrame->addChild($this->generateRecordsFrame($records, $lines, $player)); $listFrame->addChild($this->generateRecordsFrame($records, $lines, $player));