MCPcopy Create free account
hub / github.com/DFHack/dfhack / init_enable_script

Function init_enable_script

library/Core.cpp:338–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338static bool init_enable_script(color_ostream &out, lua_State *state, const std::string_view name, bool enable)
339{
340 if (!lua_checkstack(state, 4))
341 return false;
342 Lua::PushDFHack(state);
343 lua_getfield(state, -1, "enable_script");
344 lua_remove(state, -2);
345 lua_pushlstring(state, name.data(), name.size());
346 lua_pushboolean(state, enable);
347 return true;
348}
349
350command_result Core::enableLuaScript(color_ostream &out, const std::string_view name, bool enabled)
351{

Callers 1

enableLuaScriptMethod · 0.85

Calls 6

lua_checkstackFunction · 0.85
lua_getfieldFunction · 0.85
lua_pushlstringFunction · 0.85
lua_pushbooleanFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected