From f7d78539d34ee5d9529a32fecfe17537ec1b6bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 2 Dec 2011 10:56:40 +0100 Subject: [PATCH] Renaming Creatures to Units --- library/CMakeLists.txt | 4 +- library/Core.cpp | 2 +- library/include/DFHack.h | 2 +- library/include/dfhack/Core.h | 6 +- library/include/dfhack/modules/Items.h | 4 +- .../dfhack/modules/{Creatures.h => Units.h} | 92 +++++++++---------- library/modules/Items.cpp | 4 +- library/modules/{Creatures.cpp => Units.cpp} | 54 +++++------ library/modules/kitchen.cpp | 2 +- library/private/ModuleFactory.h | 2 +- plugins/cleaners.cpp | 6 +- plugins/cleanowned.cpp | 6 +- plugins/devel/kittens.cpp | 14 +-- plugins/fastdwarf.cpp | 8 +- plugins/probe.cpp | 6 +- plugins/stonesense | 2 +- tools/playground/creaturemanager.cpp | 2 +- tools/playground/renamer.cpp | 2 +- 18 files changed, 109 insertions(+), 109 deletions(-) rename library/include/dfhack/modules/{Creatures.h => Units.h} (92%) rename library/modules/{Creatures.cpp => Units.cpp} (91%) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 3be6a1975..afa60d1c3 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -43,7 +43,7 @@ include/dfhack/extra/stopwatch.h include/dfhack/extra/termutil.h include/dfhack/modules/Buildings.h include/dfhack/modules/Constructions.h -include/dfhack/modules/Creatures.h +include/dfhack/modules/Units.h include/dfhack/modules/Engravings.h include/dfhack/modules/Gui.h include/dfhack/modules/Items.h @@ -77,7 +77,7 @@ depends/tthread/tinythread.cpp modules/Buildings.cpp modules/Constructions.cpp -modules/Creatures.cpp +modules/Units.cpp modules/Engravings.cpp modules/Gui.cpp modules/Items.cpp diff --git a/library/Core.cpp b/library/Core.cpp index 077c368d5..efc9cf83c 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -775,7 +775,7 @@ TYPE * Core::get##TYPE() \ return s_mods.p##TYPE;\ } -MODULE_GETTER(Creatures); +MODULE_GETTER(Units); MODULE_GETTER(Engravings); MODULE_GETTER(Maps); MODULE_GETTER(Gui); diff --git a/library/include/DFHack.h b/library/include/DFHack.h index 7a9c8c0ad..938decbc8 100644 --- a/library/include/DFHack.h +++ b/library/include/DFHack.h @@ -57,7 +57,7 @@ distribution. #include "dfhack/modules/Engravings.h" #include "dfhack/modules/Materials.h" #include "dfhack/modules/Constructions.h" -#include "dfhack/modules/Creatures.h" +#include "dfhack/modules/Units.h" #include "dfhack/modules/Translation.h" #include "dfhack/modules/World.h" #include "dfhack/modules/Items.h" diff --git a/library/include/dfhack/Core.h b/library/include/dfhack/Core.h index e4e2171ab..2d453bc10 100644 --- a/library/include/dfhack/Core.h +++ b/library/include/dfhack/Core.h @@ -46,7 +46,7 @@ namespace DFHack { class Process; class Module; - class Creatures; + class Units; class Engravings; class Maps; class Gui; @@ -96,7 +96,7 @@ namespace DFHack bool isValid(void) { return !errorstate; } /// get the creatures module - Creatures * getCreatures(); + Units * getUnits(); /// get the engravings module Engravings * getEngravings(); /// get the maps module @@ -158,7 +158,7 @@ namespace DFHack // Module storage struct { - Creatures * pCreatures; + Units * pUnits; Engravings * pEngravings; Maps * pMaps; Gui * pGui; diff --git a/library/include/dfhack/modules/Items.h b/library/include/dfhack/modules/Items.h index af7b44d71..f6efcc8ab 100644 --- a/library/include/dfhack/modules/Items.h +++ b/library/include/dfhack/modules/Items.h @@ -42,7 +42,7 @@ namespace DFHack class Context; class DFContextShared; -class Creatures; +class Units; /** * Item flags. A bit fuzzy. @@ -594,7 +594,7 @@ public: /// which items does it contain? bool getContainedItems(const df_item * item, /*output*/ std::vector &items); /// wipe out the owner records - bool removeItemOwner(df_item * item, Creatures *creatures); + bool removeItemOwner(df_item * item, Units *creatures); /// read item references, filtered by class bool readItemRefs(const df_item * item, const ClassNameCheck &classname, /*output*/ std::vector &values); diff --git a/library/include/dfhack/modules/Creatures.h b/library/include/dfhack/modules/Units.h similarity index 92% rename from library/include/dfhack/modules/Creatures.h rename to library/include/dfhack/modules/Units.h index 8e5ea76b8..886b2eeb9 100644 --- a/library/include/dfhack/modules/Creatures.h +++ b/library/include/dfhack/modules/Units.h @@ -32,16 +32,16 @@ distribution. #include "dfhack/Module.h" #include "dfhack/modules/Items.h" /** - * \defgroup grp_creatures Creatures module parts + * \defgroup grp_units Unit module parts * @ingroup grp_modules */ namespace DFHack { /** * easy access to first crature flags block - * \ingroup grp_creatures + * \ingroup grp_units */ - union t_creaturflags1 + union t_unitflags1 { uint32_t whole;/*!< Access all flags as a single 32bit number. */ struct @@ -88,7 +88,7 @@ namespace DFHack } bits; }; - union t_creaturflags2 + union t_unitflags2 { uint32_t whole; /*!< Access all flags as a single 32bit number. */ struct @@ -135,7 +135,7 @@ namespace DFHack } bits; }; - union t_creaturflags3 + union t_unitflags3 { uint32_t whole; /*!< Access all flags as a single 32bit number. */ struct @@ -239,7 +239,7 @@ namespace DFHack }; */ /** - * \ingroup grp_creatures + * \ingroup grp_units */ struct t_skill { @@ -248,7 +248,7 @@ namespace DFHack uint32_t experience; }; /** - * \ingroup grp_creatures + * \ingroup grp_units */ struct t_job { @@ -258,7 +258,7 @@ namespace DFHack uint32_t occupationPtr; }; /** - * \ingroup grp_creatures + * \ingroup grp_units */ struct t_like { @@ -276,8 +276,8 @@ namespace DFHack #define NUM_CREATURE_MENTAL_ATTRIBUTES 13 #define NUM_CREATURE_PHYSICAL_ATTRIBUTES 6 /** - * structure for holding a copy of a creature's soul - * \ingroup grp_creatures + * Structure for holding a copy of a DF unit's soul + * \ingroup grp_units */ struct t_soul { @@ -301,23 +301,23 @@ namespace DFHack t_attrib social_awareness; }; #define MAX_COLORS 15 - struct df_creature; + struct df_unit; /** - * structure for holding a copy of a creature - * \ingroup grp_creatures + * Structure for holding a limited copy of a DF unit + * \ingroup grp_units */ - struct t_creature + struct t_unit { - df_creature * origin; + df_unit * origin; uint16_t x; uint16_t y; uint16_t z; uint32_t race; int32_t civ; - t_creaturflags1 flags1; - t_creaturflags2 flags2; - t_creaturflags3 flags3; + t_unitflags1 flags1; + t_unitflags2 flags2; + t_unitflags3 flags3; t_name name; @@ -354,8 +354,8 @@ namespace DFHack }; /** - * Creature attribute descriptor - * \ingroup grp_creatures + * Unit attribute descriptor + * \ingroup grp_units */ struct df_attrib { @@ -368,8 +368,8 @@ namespace DFHack uint32_t unk_18; }; /** - * Creature skill descriptor - * \ingroup grp_creatures + * Unit skill descriptor + * \ingroup grp_units */ struct df_skill { @@ -383,8 +383,8 @@ namespace DFHack uint32_t unk_1c; }; /** - * Creature like descriptor - * \ingroup grp_creatures + * Unit like descriptor + * \ingroup grp_units */ struct df_like { @@ -398,7 +398,7 @@ namespace DFHack }; /** * A creature's soul, as it appears in DF memory - * \ingroup grp_creatures + * \ingroup grp_units */ struct df_soul { @@ -423,7 +423,7 @@ namespace DFHack }; /** * A creature job - what it's supposed to be doing. - * \ingroup grp_creatures + * \ingroup grp_units */ struct df_job { @@ -431,7 +431,7 @@ namespace DFHack }; /** * A creature though - dwarves staring at waterfalls! - * \ingroup grp_creatures + * \ingroup grp_units */ struct df_thought { @@ -445,9 +445,9 @@ namespace DFHack }; /** * A creature, as it appears in DF memory - * \ingroup grp_creatures + * \ingroup grp_units */ - struct df_creature + struct df_unit { df_name name; // 0 std::string custom_profession; // 6c (MSVC) @@ -475,9 +475,9 @@ namespace DFHack std::vector unk_c0; std::vector unk_d0; - t_creaturflags1 flags1; // e0 - t_creaturflags2 flags2; // e4 - t_creaturflags3 flags3; // e8 + t_unitflags1 flags1; // e0 + t_unitflags2 flags2; // e4 + t_unitflags3 flags3; // e8 void ** unk_ec; int32_t unk_f0; @@ -535,7 +535,7 @@ namespace DFHack uint32_t birth_time; // 228 uint32_t unk_22c; uint32_t unk_230; - df_creature * unk_234; // suspiciously close to the pregnancy/birth stuff. Mother? + df_unit * unk_234; // suspiciously close to the pregnancy/birth stuff. Mother? uint32_t unk_238; int32_t unk_23c; int32_t unk_240; @@ -754,34 +754,34 @@ namespace DFHack /** * The Creatures module - allows reading all non-vermin creatures and their properties * \ingroup grp_modules - * \ingroup grp_creatures + * \ingroup grp_units */ - class DFHACK_EXPORT Creatures : public Module + class DFHACK_EXPORT Units : public Module { public: - std::vector * creatures; + std::vector * creatures; public: - Creatures(); - ~Creatures(); + Units(); + ~Units(); bool Start( uint32_t & numCreatures ); bool Finish(); /* Read Functions */ // Read creatures in a box, starting with index. Returns -1 if no more creatures // found. Call repeatedly do get all creatures in a specified box (uses tile coords) - int32_t GetCreatureInBox(const int32_t index, df_creature ** furball, + int32_t GetCreatureInBox(const int32_t index, df_unit ** furball, const uint16_t x1, const uint16_t y1,const uint16_t z1, const uint16_t x2, const uint16_t y2,const uint16_t z2); - df_creature * GetCreature(const int32_t index); - void CopyCreature(df_creature * source, t_creature & target); + df_unit * GetCreature(const int32_t index); + void CopyCreature(df_unit * source, t_unit & target); - bool ReadJob(const df_creature * unit, std::vector & mat); + bool ReadJob(const df_unit * unit, std::vector & mat); bool ReadInventoryByIdx(const uint32_t index, std::vector & item); - bool ReadInventoryByPtr(const df_creature * unit, std::vector & item); + bool ReadInventoryByPtr(const df_unit * unit, std::vector & item); bool ReadOwnedItemsByIdx(const uint32_t index, std::vector & item); - bool ReadOwnedItemsByPtr(const df_creature * unit, std::vector & item); + bool ReadOwnedItemsByPtr(const df_unit * unit, std::vector & item); int32_t FindIndexById(int32_t id); @@ -805,12 +805,12 @@ namespace DFHack //bool WriteCiv(const uint32_t index, const int32_t civ); //bool WritePregnancy(const uint32_t index, const uint32_t pregTimer); - void CopyNameTo(df_creature *creature, df_name * target); + void CopyNameTo(df_unit *creature, df_name * target); protected: friend class Items; bool RemoveOwnedItemByIdx(const uint32_t index, int32_t id); - bool RemoveOwnedItemByPtr(df_creature * unit, int32_t id); + bool RemoveOwnedItemByPtr(df_unit * unit, int32_t id); private: struct Private; diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index af56908bd..468c00c4d 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -39,7 +39,7 @@ using namespace std; #include "dfhack/Vector.h" #include "dfhack/modules/Materials.h" #include "dfhack/modules/Items.h" -#include "dfhack/modules/Creatures.h" +#include "dfhack/modules/Units.h" #include "ModuleFactory.h" #include #include @@ -265,7 +265,7 @@ bool Items::unknownRefs(const df_item * item, std::vector 0); } -bool Items::removeItemOwner(df_item * item, Creatures *creatures) +bool Items::removeItemOwner(df_item * item, Units *creatures) { std::vector &p_refs = item->itemrefs; for (uint32_t i=0; i using namespace DFHack; -struct Creatures::Private +struct Units::Private { bool Inited; bool Started; @@ -63,12 +63,12 @@ struct Creatures::Private Translation * trans; }; -Module* DFHack::createCreatures() +Module* DFHack::createUnits() { - return new Creatures(); + return new Units(); } -Creatures::Creatures() +Units::Units() { Core & c = Core::getInstance(); d = new Private; @@ -85,7 +85,7 @@ Creatures::Creatures() creatures = 0; try { - creatures = (vector *) OG_Creatures->getAddress ("vector"); + creatures = (vector *) OG_Creatures->getAddress ("vector"); d->dwarf_race_index_addr = OG_Creatures->getAddress("current_race"); d->dwarf_civ_id_addr = OG_Creatures->getAddress("current_civ"); } @@ -93,13 +93,13 @@ Creatures::Creatures() d->Inited = true; } -Creatures::~Creatures() +Units::~Units() { if(d->Started) Finish(); } -bool Creatures::Start( uint32_t &numcreatures ) +bool Units::Start( uint32_t &numcreatures ) { if(creatures) { @@ -112,13 +112,13 @@ bool Creatures::Start( uint32_t &numcreatures ) return false; } -bool Creatures::Finish() +bool Units::Finish() { d->Started = false; return true; } -df_creature * Creatures::GetCreature (const int32_t index) +df_unit * Units::GetCreature (const int32_t index) { if(!d->Started) return NULL; @@ -129,7 +129,7 @@ df_creature * Creatures::GetCreature (const int32_t index) } // returns index of creature actually read or -1 if no creature can be found -int32_t Creatures::GetCreatureInBox (int32_t index, df_creature ** furball, +int32_t Units::GetCreatureInBox (int32_t index, df_unit ** furball, const uint16_t x1, const uint16_t y1, const uint16_t z1, const uint16_t x2, const uint16_t y2, const uint16_t z2) { @@ -142,7 +142,7 @@ int32_t Creatures::GetCreatureInBox (int32_t index, df_creature ** furball, while (uint32_t(index) < size) { // read pointer from vector at position - df_creature * temp = creatures->at(index); + df_unit * temp = creatures->at(index); if (temp->x >= x1 && temp->x < x2) { if (temp->y >= y1 && temp->y < y2) @@ -160,7 +160,7 @@ int32_t Creatures::GetCreatureInBox (int32_t index, df_creature ** furball, return -1; } -void Creatures::CopyCreature(df_creature * source, t_creature & furball) +void Units::CopyCreature(df_unit * source, t_unit & furball) { if(!d->Started) return; // read pointer from vector at position @@ -275,7 +275,7 @@ void Creatures::CopyCreature(df_creature * source, t_creature & furball) furball.current_job.active = false; } } -int32_t Creatures::FindIndexById(int32_t creature_id) +int32_t Units::FindIndexById(int32_t creature_id) { if (!d->Started) return -1; @@ -287,7 +287,7 @@ int32_t Creatures::FindIndexById(int32_t creature_id) uint32_t size = creatures->size(); for (uint32_t index = 0; index < size; index++) { - df_creature * temp = creatures->at(index); + df_unit * temp = creatures->at(index); int32_t id = temp->id; d->IdMap[id] = index; } @@ -507,14 +507,14 @@ bool Creatures::WritePregnancy(const uint32_t index, const uint32_t pregTimer) return true; } */ -uint32_t Creatures::GetDwarfRaceIndex() +uint32_t Units::GetDwarfRaceIndex() { if(!d->Inited) return 0; Process * p = d->owner; return p->readDWord(d->dwarf_race_index_addr); } -int32_t Creatures::GetDwarfCivId() +int32_t Units::GetDwarfCivId() { if(!d->Inited) return -1; Process * p = d->owner; @@ -551,30 +551,30 @@ bool Creatures::ReadJob(const t_creature * furball, vector & mat) return true; } */ -bool Creatures::ReadInventoryByIdx(const uint32_t index, std::vector & item) +bool Units::ReadInventoryByIdx(const uint32_t index, std::vector & item) { if(!d->Started) return false; if(index >= creatures->size()) return false; - df_creature * temp = creatures->at(index); + df_unit * temp = creatures->at(index); return this->ReadInventoryByPtr(temp, item); } -bool Creatures::ReadInventoryByPtr(const df_creature * temp, std::vector & items) +bool Units::ReadInventoryByPtr(const df_unit * temp, std::vector & items) { if(!d->Started) return false; items = temp->inventory; return true; } -bool Creatures::ReadOwnedItemsByIdx(const uint32_t index, std::vector & item) +bool Units::ReadOwnedItemsByIdx(const uint32_t index, std::vector & item) { if(!d->Started ) return false; if(index >= creatures->size()) return false; - df_creature * temp = creatures->at(index); + df_unit * temp = creatures->at(index); return this->ReadOwnedItemsByPtr(temp, item); } -bool Creatures::ReadOwnedItemsByPtr(const df_creature * temp, std::vector & items) +bool Units::ReadOwnedItemsByPtr(const df_unit * temp, std::vector & items) { unsigned int i; if(!d->Started) return false; @@ -582,18 +582,18 @@ bool Creatures::ReadOwnedItemsByPtr(const df_creature * temp, std::vectorStarted) { cerr << "!d->Started FAIL" << endl; return false; } - df_creature * temp = creatures->at (index); + df_unit * temp = creatures->at (index); return this->RemoveOwnedItemByPtr(temp, id); } -bool Creatures::RemoveOwnedItemByPtr(df_creature * temp, int32_t id) +bool Units::RemoveOwnedItemByPtr(df_unit * temp, int32_t id) { if(!d->Started) return false; Process * p = d->owner; @@ -612,7 +612,7 @@ bool Creatures::RemoveOwnedItemByPtr(df_creature * temp, int32_t id) return true; } -void Creatures::CopyNameTo(df_creature * creature, df_name * target) +void Units::CopyNameTo(df_unit * creature, df_name * target) { d->trans->copyName(&creature->name, target); } diff --git a/library/modules/kitchen.cpp b/library/modules/kitchen.cpp index 001e9dd40..c98684e08 100644 --- a/library/modules/kitchen.cpp +++ b/library/modules/kitchen.cpp @@ -15,7 +15,7 @@ using namespace std; #include "dfhack/Vector.h" #include "dfhack/modules/Materials.h" #include "dfhack/modules/Items.h" -#include "dfhack/modules/Creatures.h" +#include "dfhack/modules/Units.h" #include "dfhack/modules/kitchen.h" #include "ModuleFactory.h" #include diff --git a/library/private/ModuleFactory.h b/library/private/ModuleFactory.h index 8a795c0d6..af34c35af 100644 --- a/library/private/ModuleFactory.h +++ b/library/private/ModuleFactory.h @@ -30,7 +30,7 @@ distribution. namespace DFHack { class Module; - Module* createCreatures(); + Module* createUnits(); Module* createEngravings(); Module* createGui(); Module* createWorld(); diff --git a/plugins/cleaners.cpp b/plugins/cleaners.cpp index 94de962ad..b93b18f37 100644 --- a/plugins/cleaners.cpp +++ b/plugins/cleaners.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include using namespace DFHack; @@ -135,7 +135,7 @@ command_result cleanitems (Core * c) command_result cleanunits (Core * c) { - DFHack::Creatures * Creatures = c->getCreatures(); + DFHack::Units * Creatures = c->getUnits(); uint32_t num_creatures; if (!Creatures->Start(num_creatures)) @@ -147,7 +147,7 @@ command_result cleanunits (Core * c) int cleaned_units = 0, cleaned_total = 0; for (std::size_t i = 0; i < num_creatures; i++) { - df_creature *unit = Creatures->creatures->at(i); + df_unit *unit = Creatures->creatures->at(i); int num = unit->contaminants.size(); if (num) { diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp index cc4bee1e3..4b1b61e63 100644 --- a/plugins/cleanowned.cpp +++ b/plugins/cleanowned.cpp @@ -16,7 +16,7 @@ using namespace std; #include #include #include -#include +#include #include #include using namespace DFHack; @@ -90,7 +90,7 @@ DFhackCExport command_result df_cleanowned (Core * c, vector & paramete c->Suspend(); DFHack::Materials *Materials = c->getMaterials(); DFHack::Items *Items = c->getItems(); - DFHack::Creatures *Creatures = c->getCreatures(); + DFHack::Units *Creatures = c->getUnits(); DFHack::Translation *Tran = c->getTranslation(); uint32_t num_creatures; @@ -195,7 +195,7 @@ DFhackCExport command_result df_cleanowned (Core * c, vector & paramete if (owner_index >= 0) { - DFHack::df_creature * temp = Creatures->GetCreature(owner_index); + DFHack::df_unit * temp = Creatures->GetCreature(owner_index); info = temp->name.first_name; if (!temp->name.nick_name.empty()) info += std::string(" '") + temp->name.nick_name + "'"; diff --git a/plugins/devel/kittens.cpp b/plugins/devel/kittens.cpp index 414d8d5a0..7c502143c 100644 --- a/plugins/devel/kittens.cpp +++ b/plugins/devel/kittens.cpp @@ -329,14 +329,14 @@ DFhackCExport command_result kittens (Core * c, vector & parameters) } } -#include "dfhack/modules/Creatures.h" +#include "dfhack/modules/Units.h" #include "dfhack/VersionInfo.h" #include command_result test_creature_offsets(Core* c, vector< string >& parameters) { - uint32_t off_vinfo = c->vinfo->getGroup("Creatures")->getGroup("creature")->/*getGroup("advanced")->*/getOffset("custom_profession"); - uint32_t off_struct = offsetof(df_creature,custom_profession); + uint32_t off_vinfo = c->vinfo->getGroup("Creatures")->getGroup("creature")->/*getGroup("advanced")->*/getOffset("custom_profession"); + uint32_t off_struct = offsetof(df_unit,custom_profession); c->con.print("Struct 0x%x, vinfo 0x%x\n", off_struct, off_vinfo); return CR_OK; }; @@ -344,7 +344,7 @@ command_result test_creature_offsets(Core* c, vector< string >& parameters) command_result creat_job (Core * c, vector< string >& parameters) { c->Suspend(); - Creatures * cr = c->getCreatures(); + Units * cr = c->getUnits(); Gui * g = c-> getGui(); uint32_t num_cr = 0; int32_t cx,cy,cz; @@ -364,7 +364,7 @@ command_result creat_job (Core * c, vector< string >& parameters) auto iter = cr->creatures->begin(); while (iter != cr->creatures->end()) { - df_creature * unit = *iter; + df_unit * unit = *iter; if(cx == unit->x && cy == unit->y && cz == unit->z) { c->con.print("%d:%s - address 0x%x - job 0x%x\n" @@ -372,8 +372,8 @@ command_result creat_job (Core * c, vector< string >& parameters) unit->id, unit->name.first_name.c_str(), unit, - uint32_t(unit) + offsetof(df_creature,current_job), - uint32_t(unit) + offsetof(df_creature,current_soul), + uint32_t(unit) + offsetof(df_unit,current_job), + uint32_t(unit) + offsetof(df_unit,current_soul), uint32_t(unit->current_soul) + offsetof(df_soul,likes) ); df_soul * s = unit->current_soul; diff --git a/plugins/fastdwarf.cpp b/plugins/fastdwarf.cpp index 88872af7a..534e34614 100644 --- a/plugins/fastdwarf.cpp +++ b/plugins/fastdwarf.cpp @@ -13,7 +13,7 @@ using namespace std; #include #include #include -#include +#include using namespace DFHack; // dfhack interface @@ -33,9 +33,9 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) { if (!enable_fastdwarf) return CR_OK; - df_creature *cre; - DFHack::Creatures * cr = c->getCreatures(); - static vector *v = cr->creatures; + df_unit *cre; + DFHack::Units * cr = c->getUnits(); + static vector *v = cr->creatures; uint32_t race = cr->GetDwarfRaceIndex(); uint32_t civ = cr->GetDwarfCivId(); if (!v) diff --git a/plugins/probe.cpp b/plugins/probe.cpp index f76af5023..59588185f 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -15,7 +15,7 @@ using namespace std; #include #include #include -#include +#include #include #include #include @@ -57,7 +57,7 @@ DFhackCExport command_result df_cprobe (Core * c, vector & parameters) BEGIN_PROBE: c->Suspend(); DFHack::Gui *Gui = c->getGui(); - DFHack::Creatures * cr = c->getCreatures(); + DFHack::Units * cr = c->getUnits(); int32_t cursorX, cursorY, cursorZ; Gui->getCursorCoords(cursorX,cursorY,cursorZ); if(cursorX == -30000) @@ -70,7 +70,7 @@ DFhackCExport command_result df_cprobe (Core * c, vector & parameters) cr->Start(ncr); for(auto i = 0; i < ncr; i++) { - df_creature * unit = cr->GetCreature( i ); + df_unit * 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); diff --git a/plugins/stonesense b/plugins/stonesense index 71d28909e..dbfeaf935 160000 --- a/plugins/stonesense +++ b/plugins/stonesense @@ -1 +1 @@ -Subproject commit 71d28909ec397d0a772e6135a822cc1c4a5fd3a7 +Subproject commit dbfeaf935df92644b72746842166baf700450e15 diff --git a/tools/playground/creaturemanager.cpp b/tools/playground/creaturemanager.cpp index d0a66cc85..59e94e9fc 100644 --- a/tools/playground/creaturemanager.cpp +++ b/tools/playground/creaturemanager.cpp @@ -70,7 +70,7 @@ using namespace std; #define DFHACK_WANT_MISCUTILS #include -#include +#include /* Note about magic numbers: * If you have an idea how to better solve this, tell me. Currently I'd be diff --git a/tools/playground/renamer.cpp b/tools/playground/renamer.cpp index 7008554d9..8b3be7eb8 100644 --- a/tools/playground/renamer.cpp +++ b/tools/playground/renamer.cpp @@ -9,7 +9,7 @@ using namespace std; #define DFHACK_WANT_MISCUTILS #include #include -#include +#include #include vector< vector > englishWords;