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/colonies.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/colonies.cpp')
| -rw-r--r-- | plugins/colonies.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/colonies.cpp b/plugins/colonies.cpp index ba1e16cc..9ebbc8a9 100644 --- a/plugins/colonies.cpp +++ b/plugins/colonies.cpp @@ -23,8 +23,8 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> { commands.clear(); commands.push_back(PluginCommand("colonies", - "List or change wild colonies (ants hills and such)", - colonies)); + "List or change wild colonies (ants hills and such)", + colonies)); return CR_OK; } @@ -57,19 +57,18 @@ DFhackCExport command_result colonies (Core * c, vector <string> & parameters) if(help) { c->con.print("Without any options, this command lists all the vermin colonies present.\n" - "Options:\n" - "kill - destroy colonies\n" - "bees - turn colonies into honey bees\n" - ); + "Options:\n" + "kill - destroy colonies\n" + "bees - turn colonies into honey bees\n" + ); return CR_OK; } if (destroy && convert) { c->con.printerr("Kill or make bees? DECIDE!\n"); - c->Resume(); return CR_FAILURE; } - c->Suspend(); + CoreSuspender suspend(c); Materials * materials = c->getMaterials(); @@ -84,7 +83,6 @@ DFhackCExport command_result colonies (Core * c, vector <string> & parameters) materials->Finish(); - c->Resume(); return CR_OK; } @@ -110,11 +108,13 @@ void convertColonies(Materials *Materials) { int bee_idx = -1; for (size_t i = 0; i < Materials->raceEx.size(); i++) + { if (Materials->raceEx[i].id == "HONEY_BEE") { bee_idx = i; break; } + } if (bee_idx == -1) { @@ -153,8 +153,8 @@ void showColonies(Core *c, Materials *Materials) if(sp.race != -1) race = Materials->raceEx[sp.race].id; - c->con.print("Colony %u: %s at %d:%d:%d\n", i, - race.c_str(), sp.x, sp.y, sp.z); + c->con.print("Colony %u: %s at %d:%d:%d\n", i, + race.c_str(), sp.x, sp.y, sp.z); } } |
