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

Method addCustomScript

components/lua/scriptscontainer.cpp:62–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 bool ScriptsContainer::addCustomScript(int scriptId, std::string_view initData)
63 {
64 assert(mLua.getConfiguration().isCustomScript(scriptId));
65 bool ok = false;
66 mLua.protectedCall([&](LuaView& view) {
67 std::optional<sol::function> onInit, onLoad;
68 ok = addScript(view, scriptId, onInit, onLoad);
69 if (ok && onInit)
70 callOnInit(view, scriptId, *onInit, initData);
71 });
72 return ok;
73 }
74
75 void ScriptsContainer::addAutoStartedScripts()
76 {

Callers 2

TEST_FFunction · 0.80
addCustomLocalScriptMethod · 0.80

Calls 2

isCustomScriptMethod · 0.80
protectedCallMethod · 0.45

Tested by 1

TEST_FFunction · 0.64