diff --git a/src/Components/Modules/ConnectProtocol.cpp b/src/Components/Modules/ConnectProtocol.cpp index a3757d53..442e61ff 100644 --- a/src/Components/Modules/ConnectProtocol.cpp +++ b/src/Components/Modules/ConnectProtocol.cpp @@ -2,7 +2,7 @@ namespace Components { - ConnectProtocol::Container ConnectProtocol::ConnectContainer = { false, false, "" }; + ConnectProtocol::Container ConnectProtocol::ConnectContainer = { false, "" }; bool ConnectProtocol::Evaluated() { @@ -202,12 +202,10 @@ namespace Components }); // Invocation handler - // TODO: Don't call it every frame, once is enough! - Renderer::OnFrame([] () + Renderer::Once([] () { - if (!ConnectProtocol::ConnectContainer.Invoked && ConnectProtocol::Used()) + if (ConnectProtocol::Used()) { - ConnectProtocol::ConnectContainer.Invoked = true; Command::Execute(fmt::sprintf("connect %s", ConnectProtocol::ConnectContainer.ConnectString.data()), false); } }); diff --git a/src/Components/Modules/ConnectProtocol.hpp b/src/Components/Modules/ConnectProtocol.hpp index e67ea63d..078c7722 100644 --- a/src/Components/Modules/ConnectProtocol.hpp +++ b/src/Components/Modules/ConnectProtocol.hpp @@ -14,7 +14,6 @@ namespace Components { public: bool Evaluated; - bool Invoked; std::string ConnectString; };