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

Method setupSerializableTimer

components/lua/scriptscontainer.cpp:690–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688 }
689
690 void ScriptsContainer::setupSerializableTimer(
691 TimerType type, double time, int scriptId, std::string_view callbackName, sol::main_object callbackArg)
692 {
693 Timer t;
694 t.mCallback = std::string(callbackName);
695 t.mScriptId = scriptId;
696 t.mSerializable = true;
697 t.mTime = time;
698 t.mArg = std::move(callbackArg);
699 t.mSerializedArg = serialize(t.mArg, mSerializer);
700 LoadedData& data = ensureLoaded();
701 insertTimer(type == TimerType::GAME_TIME ? data.mGameTimersQueue : data.mSimulationTimersQueue, std::move(t));
702 }
703
704 void ScriptsContainer::setupUnsavableTimer(
705 TimerType type, double time, int scriptId, sol::main_protected_function callback)

Callers 2

TEST_FFunction · 0.80

Calls 1

serializeFunction · 0.70

Tested by 1

TEST_FFunction · 0.64