summaryrefslogtreecommitdiff
path: root/plugins/tubefill.cpp
diff options
context:
space:
mode:
authorQuietust2012-01-21 18:31:15 -0600
committerQuietust2012-01-21 18:31:15 -0600
commit2cc6bcf0e97dbdf60492067cd71dc79432a35687 (patch)
treee893504d15ef59e8803573f6f4483d2e3ec9ca34 /plugins/tubefill.cpp
parentccf22bed10a78504701bbdb1f8177a16cf9ffdde (diff)
downloaddfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.gz
dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.bz2
dfhack-2cc6bcf0e97dbdf60492067cd71dc79432a35687.tar.xz
Use CoreSuspender and namespace df::enums
Diffstat (limited to 'plugins/tubefill.cpp')
-rw-r--r--plugins/tubefill.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/tubefill.cpp b/plugins/tubefill.cpp
index 114b786f..1d0c4b28 100644
--- a/plugins/tubefill.cpp
+++ b/plugins/tubefill.cpp
@@ -15,6 +15,7 @@
using namespace DFHack;
using namespace DFHack::Simple;
+using namespace df::enums;
using df::global::world;
DFhackCExport command_result tubefill(DFHack::Core * c, std::vector<std::string> & params);
@@ -45,16 +46,15 @@ DFhackCExport command_result tubefill(DFHack::Core * c, std::vector<std::string>
if(params[i] == "help" || params[i] == "?")
{
c->con.print("Replenishes mined out adamantine and hollow adamantine tubes.\n"
- "May cause !!FUN!!\n"
- );
+ "May cause !!FUN!!\n"
+ );
return CR_OK;
}
}
- c->Suspend();
+ CoreSuspender suspend(c);
if (!Maps::IsValid())
{
c->con.printerr("Map is not available!\n");
- c->Resume();
return CR_FAILURE;
}
@@ -69,7 +69,7 @@ DFhackCExport command_result tubefill(DFHack::Core * c, std::vector<std::string>
DFCoord coord(block->map_pos.x >> 4, block->map_pos.y >> 4, block->map_pos.z);
if (!Maps::GetLocalFeature(feature, coord, block->local_feature))
continue;
- if (feature.type != df::feature_type::deep_special_tube)
+ if (feature.type != feature_type::deep_special_tube)
continue;
for (uint32_t x = 0; x < 16; x++)
{
@@ -106,7 +106,6 @@ DFhackCExport command_result tubefill(DFHack::Core * c, std::vector<std::string>
}
}
}
- c->Resume();
c->con.print("Found and changed %d tiles.\n", count);
return CR_OK;
}