From f34daa492c30a0d28b747817a9f2d6fb0186cf80 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 12 Dec 2024 18:46:34 +0100 Subject: clean up ReplayManager API --- src/crepe/api/Script.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/crepe/api/Script.hpp') diff --git a/src/crepe/api/Script.hpp b/src/crepe/api/Script.hpp index 225a51c..547fb8b 100644 --- a/src/crepe/api/Script.hpp +++ b/src/crepe/api/Script.hpp @@ -1,6 +1,7 @@ #pragma once #include "../manager/ComponentManager.h" +#include "../manager/ReplayManager.h" #include "BehaviorScript.h" #include "Script.h" @@ -36,6 +37,8 @@ void Script::subscribe_internal(const EventHandler & callback, [this, callback](const EventType & data) -> bool { bool & active = this->active; if (!active) return false; + ReplayManager & replay = this->mediator->replay_manager; + if (replay.get_state() == ReplayManager::PLAYING) return false; return callback(data); }, channel); -- cgit v1.2.3