diff --git a/plugins/skeleton/skeleton.cpp b/plugins/skeleton/skeleton.cpp index 293e43c8d..ea2f4fb4a 100644 --- a/plugins/skeleton/skeleton.cpp +++ b/plugins/skeleton/skeleton.cpp @@ -10,23 +10,29 @@ #include "DataDefs.h" //#include "df/world.h" +// our own, empty header. +#include "skeleton.h" + using namespace DFHack; using namespace df::enums; -// our own, empty header. -#include "skeleton.h" +// A plugin must be able to return its name and version. +// The name string provided must correspond to the filename - +// skeleton.plug.so, skeleton.plug.dylib, or skeleton.plug.dll in this case +DFHACK_PLUGIN("skeleton"); +// Any globals a plugin requires (e.g. world) should be listed here. +// For example, this line expands to "using df::global::world" and prevents the +// plugin from being loaded if df::global::world is null (i.e. missing from symbols.xml): +// +// REQUIRE_GLOBAL(world); // Here go all the command declarations... // mostly to allow having the mandatory stuff on top of the file and commands on the bottom command_result skeleton (color_ostream &out, std::vector & parameters); -// A plugin must be able to return its name and version. -// The name string provided must correspond to the filename - skeleton.plug.so or skeleton.plug.dll in this case -DFHACK_PLUGIN("skeleton"); - // Mandatory init function. If you have some global state, create it here. -DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) +DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { // Fill the command list with your commands. commands.push_back(PluginCommand( @@ -42,7 +48,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector & parameters); - DFHACK_PLUGIN("skeleton2"); +//REQUIRE_GLOBAL(world); + +command_result skeleton2 (color_ostream &out, std::vector & parameters); -DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) +DFhackCExport command_result plugin_init (color_ostream &out, std::vector &commands) { commands.push_back(PluginCommand( "skeleton2", @@ -24,7 +25,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector