diff --git a/src/core/tour/TourManager.ttslua b/src/core/tour/TourManager.ttslua index 3e7d0d1d..b5965859 100644 --- a/src/core/tour/TourManager.ttslua +++ b/src/core/tour/TourManager.ttslua @@ -106,6 +106,13 @@ do end, 0.3) end + -- Ends the tour for all players + function TourManager.stopTourForAll() + for playerColor, data in pairs(tourState) do + stopTour(Player[playerColor]) + end + end + -- Updates the card UI for the script at the current index, moves the camera to the proper -- position, and shows the card. ---@param playerColor string Player color to show the current card for diff --git a/src/core/tour/TourStarter.ttslua b/src/core/tour/TourStarter.ttslua index cc8a9ee7..0891425a 100644 --- a/src/core/tour/TourStarter.ttslua +++ b/src/core/tour/TourStarter.ttslua @@ -32,3 +32,7 @@ end function deleteStarter(_, _, _) self.destruct() end + +function onDestroy() + tourManager.stopTourForAll() +end