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

Method on_update

library/PluginManager.cpp:548–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548command_result Plugin::on_update(color_ostream &out)
549{
550 // Check things that are implicitly protected by the suspend lock
551 if (!plugin_onupdate)
552 return CR_NOT_IMPLEMENTED;
553 if (plugin_is_enabled && !*plugin_is_enabled)
554 return CR_OK;
555 // Grab mutex and call the thing
556 command_result cr = CR_NOT_IMPLEMENTED;
557 access->lock_add();
558 if(state == PS_LOADED && plugin_onupdate)
559 {
560 cr = plugin_onupdate(out);
561 Lua::Core::Reset(out, "plugin_onupdate");
562 }
563 access->lock_sub();
564 return cr;
565}
566
567command_result Plugin::set_enabled(color_ostream &out, bool enable)
568{

Callers 1

OnUpdateMethod · 0.45

Calls 2

lock_addMethod · 0.80
lock_subMethod · 0.80

Tested by

no test coverage detected