MCPcopy Create free account
hub / github.com/OpenMW/openmw / setupUnsavableTimer

Method setupUnsavableTimer

components/lua/scriptscontainer.cpp:704–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702 }
703
704 void ScriptsContainer::setupUnsavableTimer(
705 TimerType type, double time, int scriptId, sol::main_protected_function callback)
706 {
707 Timer t;
708 t.mScriptId = scriptId;
709 t.mSerializable = false;
710 t.mTime = time;
711
712 t.mCallback = mTemporaryCallbackCounter;
713 getScript(t.mScriptId).mTemporaryCallbacks.emplace(mTemporaryCallbackCounter, std::move(callback));
714 mTemporaryCallbackCounter++;
715 LoadedData& data = ensureLoaded();
716 insertTimer(type == TimerType::GAME_TIME ? data.mGameTimersQueue : data.mSimulationTimersQueue, std::move(t));
717 }
718
719 void ScriptsContainer::callTimer(const Timer& t)
720 {

Callers 2

TEST_FFunction · 0.80

Calls 1

emplaceMethod · 0.80

Tested by 1

TEST_FFunction · 0.64