diff --git a/changelog.txt b/changelog.txt index ebbf5e54..43e56256 100644 --- a/changelog.txt +++ b/changelog.txt @@ -12,6 +12,9 @@ #Bug Fixes - deactivate Plugins if they cause uncaught exceptions +- finish callbacks got triggered before corresponding checkpoint callback +-- some CPs of your local records might be messed up +-- you can fix them by either deleting the record "//delrec ", or simply drive a better time - fixed typo in actions panel of players list - fixed crashing GameMode-Settings table on other languages than english diff --git a/core/Callbacks/TrackManiaCallbacks.php b/core/Callbacks/TrackManiaCallbacks.php index 9e7d362b..4dedae7e 100644 --- a/core/Callbacks/TrackManiaCallbacks.php +++ b/core/Callbacks/TrackManiaCallbacks.php @@ -22,7 +22,7 @@ use ManiaControl\ManiaControl; * @copyright 2014-2020 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class TrackManiaCallbacks implements CallbackListener { +class TrackManiaCallbacks implements CallbackListener, CallQueueListener { /* * Private properties */ @@ -106,9 +106,13 @@ class TrackManiaCallbacks implements CallbackListener { */ public function handleWayPointCallback(OnWayPointEventStructure $structure) { if ($structure->getIsEndRace()) { - $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_ONFINISHLINE, $structure); + $this->maniaControl->getCallQueueManager()->registerListening($this, function () use ($structure) { + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_ONFINISHLINE, $structure); + }); } else if ($structure->getIsEndLap()) { - $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_ONLAPFINISH, $structure); + $this->maniaControl->getCallQueueManager()->registerListening($this, function () use ($structure) { + $this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::TM_ONLAPFINISH, $structure); + }); } } }