From 2ea6233774552c23099280b7c26764ebff41b522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 24 May 2014 18:36:08 +0200 Subject: [PATCH] lap finish instead of usual checkpoint callback --- application/core/Callbacks/TrackManiaCallbacks.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/core/Callbacks/TrackManiaCallbacks.php b/application/core/Callbacks/TrackManiaCallbacks.php index 0a9b9a88..3b44590f 100644 --- a/application/core/Callbacks/TrackManiaCallbacks.php +++ b/application/core/Callbacks/TrackManiaCallbacks.php @@ -88,7 +88,6 @@ class TrackManiaCallbacks implements CallbackListener { } $checkpointCallback = new RecordCallback(); - $checkpointCallback->name = $checkpointCallback::CHECKPOINT; $checkpointCallback->isLegacyCallback = true; $checkpointCallback->setPlayer($player); $checkpointCallback->time = (int)$data[2]; @@ -101,6 +100,12 @@ class TrackManiaCallbacks implements CallbackListener { $checkpointCallback->lapCheckpoint -= $checkpointCallback->lap * $currentMap->nbCheckpoints; } + if ($checkpointCallback->lapCheckpoint === 0) { + $checkpointCallback->name = $checkpointCallback::LAPFINISH; + } else { + $checkpointCallback->name = $checkpointCallback::CHECKPOINT; + } + $this->maniaControl->callbackManager->triggerCallback($checkpointCallback); }