diff --git a/Memory.xml b/Memory.xml index 26495c4f7..366dc48ba 100644 --- a/Memory.xml +++ b/Memory.xml @@ -2269,6 +2269,7 @@
+
diff --git a/plugins/devel/df2mc b/plugins/devel/df2mc index 704705708..0f6389f41 160000 --- a/plugins/devel/df2mc +++ b/plugins/devel/df2mc @@ -1 +1 @@ -Subproject commit 704705708861ebf46d2d8bea64d08cf3d4986eed +Subproject commit 0f6389f4121d6cf3d447fb72a5b561d8d66b0de8 diff --git a/plugins/probe.cpp b/plugins/probe.cpp index 2e1997caf..6006e77ef 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -15,6 +15,7 @@ using namespace std; #include #include #include +#include #include #include #include @@ -27,6 +28,7 @@ using std::string; using namespace DFHack; DFhackCExport command_result df_probe (Core * c, vector & parameters); +DFhackCExport command_result df_cprobe (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -39,6 +41,9 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector commands.push_back(PluginCommand("probe", "A tile probe", df_probe)); + commands.push_back(PluginCommand("cprobe", + "A creature probe", + df_cprobe)); return CR_OK; } @@ -47,6 +52,37 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } +DFhackCExport command_result df_cprobe (Core * c, vector & parameters) +{ + Console & con = c->con; + BEGIN_PROBE: + c->Suspend(); + DFHack::Gui *Gui = c->getGui(); + DFHack::Creatures * cr = c->getCreatures(); + int32_t cursorX, cursorY, cursorZ; + Gui->getCursorCoords(cursorX,cursorY,cursorZ); + if(cursorX == -30000) + { + con.printerr("No cursor; place cursor over creature to probe.\n"); + } + else + { + uint32_t ncr; + cr->Start(ncr); + for(auto i = 0; i < ncr; i++) + { + df_creature * unit = cr->GetCreature( i ); + if(unit->x == cursorX && unit->y == cursorY && unit->z == cursorZ) + { + con.print("Creature %d, race %d (%x), civ %d (%x)\n", unit->id, unit->race, unit->race, unit->civ, unit->civ); + break; + } + } + } + c->Resume(); + return CR_OK; +} + DFhackCExport command_result df_probe (Core * c, vector & parameters) { //bool showBlock, showDesig, showOccup, showTile, showMisc;