diff options
| author | Quietust | 2012-01-21 18:31:15 -0600 |
|---|---|---|
| committer | Quietust | 2012-01-21 18:31:15 -0600 |
| commit | 2cc6bcf0e97dbdf60492067cd71dc79432a35687 (patch) | |
| tree | e893504d15ef59e8803573f6f4483d2e3ec9ca34 /plugins/cleanowned.cpp | |
| parent | ccf22bed10a78504701bbdb1f8177a16cf9ffdde (diff) | |
| download | dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.gz dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.bz2 dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.xz | |
Use CoreSuspender and namespace df::enums
Diffstat (limited to 'plugins/cleanowned.cpp')
| -rw-r--r-- | plugins/cleanowned.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp index be6012b7..719e58f0 100644 --- a/plugins/cleanowned.cpp +++ b/plugins/cleanowned.cpp @@ -18,11 +18,13 @@ using namespace std; #include "modules/Units.h" #include "modules/Materials.h" #include "modules/Translation.h" -using namespace DFHack; -using namespace DFHack::Simple; #include "DataDefs.h" #include "df/world.h" +using namespace DFHack; +using namespace DFHack::Simple; +using namespace df::enums; + using df::global::world; DFhackCExport command_result df_cleanowned (Core * c, vector <string> & parameters); @@ -91,7 +93,9 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete return CR_FAILURE; } } - c->Suspend(); + + CoreSuspender suspend(c); + DFHack::Materials *Materials = c->getMaterials(); DFHack::Units *Creatures = c->getUnits(); DFHack::Translation *Tran = c->getTranslation(); @@ -132,13 +136,13 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete else if (item->flags.bits.on_ground) { int32_t type = item->getType(); - if(type == df::item_type::MEAT || - type == df::item_type::FISH || - type == df::item_type::VERMIN || - type == df::item_type::PET || - type == df::item_type::PLANT || - type == df::item_type::CHEESE || - type == df::item_type::FOOD + if(type == item_type::MEAT || + type == item_type::FISH || + type == item_type::VERMIN || + type == item_type::PET || + type == item_type::PLANT || + type == item_type::CHEESE || + type == item_type::FOOD ) { confiscate = true; @@ -207,6 +211,5 @@ DFhackCExport command_result df_cleanowned (Core * c, vector <string> & paramete c->con.print("\n"); } } - c->Resume(); return CR_OK; } |
