From bded439c038e081bd81483739cdb5cb394520041 Mon Sep 17 00:00:00 2001 From: agiorla Date: Tue, 3 Jul 2018 12:13:00 -0400 Subject: [PATCH] Local record on last lap is now properly saved (#186) --- plugins/MCTeam/LocalRecordsPlugin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/MCTeam/LocalRecordsPlugin.php b/plugins/MCTeam/LocalRecordsPlugin.php index 1c46eb37..4485733d 100644 --- a/plugins/MCTeam/LocalRecordsPlugin.php +++ b/plugins/MCTeam/LocalRecordsPlugin.php @@ -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()); + } }