small fix localrecords

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

View File

@ -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 {