Local record on last lap is now properly saved (#186)

This commit is contained in:
agiorla 2018-07-03 12:13:00 -04:00 committed by Lukas Kremsmayr
parent 56b361fff9
commit bded439c03
1 changed files with 9 additions and 1 deletions

View File

@ -464,7 +464,15 @@ class LocalRecordsPlugin implements ManialinkPageAnswerListener, CallbackListene
* @param \ManiaControl\Callbacks\Structures\TrackMania\OnWayPointEventStructure $structure
*/
public function handleFinishCallback(OnWayPointEventStructure $structure) {
$this->saveRecord($structure, $structure->getRaceTime());;
$multiLapSaveSingle = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MULTILAP_SAVE_SINGLE);
if ($this->scriptName != "TimeAttack" && $multiLapSaveSingle) {
//Save last lap time only
$this->saveRecord($structure, $structure->getLapTime());
} else {
//Save full race time
$this->saveRecord($structure, $structure->getRaceTime());
}
}