lap finish instead of usual checkpoint callback

This commit is contained in:
Steffen Schröder 2014-05-24 18:36:08 +02:00
parent cf345dfdc3
commit 2ea6233774

View File

@ -88,7 +88,6 @@ class TrackManiaCallbacks implements CallbackListener {
} }
$checkpointCallback = new RecordCallback(); $checkpointCallback = new RecordCallback();
$checkpointCallback->name = $checkpointCallback::CHECKPOINT;
$checkpointCallback->isLegacyCallback = true; $checkpointCallback->isLegacyCallback = true;
$checkpointCallback->setPlayer($player); $checkpointCallback->setPlayer($player);
$checkpointCallback->time = (int)$data[2]; $checkpointCallback->time = (int)$data[2];
@ -101,6 +100,12 @@ class TrackManiaCallbacks implements CallbackListener {
$checkpointCallback->lapCheckpoint -= $checkpointCallback->lap * $currentMap->nbCheckpoints; $checkpointCallback->lapCheckpoint -= $checkpointCallback->lap * $currentMap->nbCheckpoints;
} }
if ($checkpointCallback->lapCheckpoint === 0) {
$checkpointCallback->name = $checkpointCallback::LAPFINISH;
} else {
$checkpointCallback->name = $checkpointCallback::CHECKPOINT;
}
$this->maniaControl->callbackManager->triggerCallback($checkpointCallback); $this->maniaControl->callbackManager->triggerCallback($checkpointCallback);
} }