@ -116,7 +116,8 @@ To register ruby code to be run every graphic frame, use:
To stop being called, use:
df.onupdate_unregister handle
The same mechanism is available for 'onstatechange'.
The same mechanism is available for 'onstatechange', but the
SC_BEGIN_UNLOAD event is not propagated to the ruby handler.
C++ object manipulation
@ -181,7 +181,9 @@ DFhackCExport command_result plugin_onstatechange ( color_ostream &out, state_ch
SCASE(MAP_UNLOADED);
SCASE(VIEWSCREEN_CHANGED);
SCASE(CORE_INITIALIZED);
SCASE(BEGIN_UNLOAD);
// if we go through plugin_eval at BEGIN_UNLOAD, it'll
// try to get the suspend lock and deadlock at df exit
case SC_BEGIN_UNLOAD : return CR_OK;
#undef SCASE
}