diff options
| author | Quietust | 2012-01-24 11:32:34 -0600 |
|---|---|---|
| committer | Quietust | 2012-01-24 11:32:34 -0600 |
| commit | cc7c7795a161a467892ae60aa2ab67f5ff659e8f (patch) | |
| tree | fcd4d92585de379e4c2fca7648ab2dfc1761066c /plugins/probe.cpp | |
| parent | 02d75e2c94eebaa771aef6da9ff9d83a786f904b (diff) | |
| download | dfhack-cc7c7795a161a467892ae60aa2ab67f5ff659e8f.tar.gz dfhack-cc7c7795a161a467892ae60aa2ab67f5ff659e8f.tar.bz2 dfhack-cc7c7795a161a467892ae60aa2ab67f5ff659e8f.tar.xz | |
Kill the Units module, and add another pair of methods to the Items module to simplify some things
Diffstat (limited to 'plugins/probe.cpp')
| -rw-r--r-- | plugins/probe.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/probe.cpp b/plugins/probe.cpp index 8d588f28..4fd91d3c 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -21,10 +21,15 @@ using namespace std; #include "modules/MapCache.h" #include "MiscUtils.h" +#include "df/world.h" + + using std::vector; using std::string; using namespace DFHack; +using namespace DFHack::Simple; using namespace df::enums; +using df::global::world; DFhackCExport command_result df_probe (Core * c, vector <string> & parameters); DFhackCExport command_result df_cprobe (Core * c, vector <string> & parameters); @@ -56,7 +61,6 @@ DFhackCExport command_result df_cprobe (Core * c, vector <string> & parameters) Console & con = c->con; CoreSuspender suspend(c); DFHack::Gui *Gui = c->getGui(); - DFHack::Units * cr = c->getUnits(); int32_t cursorX, cursorY, cursorZ; Gui->getCursorCoords(cursorX,cursorY,cursorZ); if(cursorX == -30000) @@ -65,11 +69,10 @@ DFhackCExport command_result df_cprobe (Core * c, vector <string> & parameters) } else { - uint32_t ncr; - cr->Start(ncr); + uint32_t ncr = world->units.all.size(); for(auto i = 0; i < ncr; i++) { - df::unit * unit = cr->GetCreature( i ); + df::unit * unit = world->units.all[i]; if(unit->pos.x == cursorX && unit->pos.y == cursorY && unit->pos.z == cursorZ) { con.print("Creature %d, race %d (%x), civ %d (%x)\n", unit->id, unit->race, unit->race, unit->civ_id, unit->civ_id); |
