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 //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++) {
$recordFrame = $this->generateRecordLineFrame($records[$i], $player); if(array_key_exists($i, $records)){ //If there are no records behind you
$recordFrame->setY($y); $recordFrame = $this->generateRecordLineFrame($records[$i], $player);
$listFrame->addChild($recordFrame); $recordFrame->setY($y);
$y -= $lineHeight; $listFrame->addChild($recordFrame);
$y -= $lineHeight;
}
} }
} else { } else {