Strip commands.clear() from all plugins
Fix changeitem - a variable name has changed in item flags
develop
Petr Mrázek 2012-03-29 18:37:22 +02:00
parent cc54d5dfa9
commit 004acdad4e
26 changed files with 2 additions and 28 deletions

@ -1 +1 @@
Subproject commit 8bb7f923b1d124610db7e30aeb3be8f4cb9bd021 Subproject commit 3e1c728640d8f5a9501908064a2d5385a156058c

@ -55,8 +55,6 @@ DFHACK_PLUGIN("advtools");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (!ui_advmode) if (!ui_advmode)
return CR_OK; return CR_OK;

@ -61,7 +61,6 @@ const string changeitem_help =
DFhackCExport command_result plugin_init ( color_ostream &out, vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"changeitem", "Change item attributes (material, quality).", "changeitem", "Change item attributes (material, quality).",
df_changeitem, false, df_changeitem, false,
@ -315,7 +314,7 @@ command_result changeitem_execute(
out.printerr("change denied: subtype doesn't match. use 'force' to override.\n"); out.printerr("change denied: subtype doesn't match. use 'force' to override.\n");
} }
item->flags.bits.unk8 = 0; // recalc temperatures next time touched item->flags.bits.temps_computed = 0; // recalc temperatures next time touched
item->flags.bits.weight_computed = 0; // recalc weight next time touched item->flags.bits.weight_computed = 0; // recalc weight next time touched
} }
return CR_OK; return CR_OK;

@ -88,7 +88,6 @@ DFHACK_PLUGIN("changelayer");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
// Fill the command list with your commands. // Fill the command list with your commands.
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"changelayer", "Change a whole geology layer.", "changelayer", "Change a whole geology layer.",
changelayer, false, /* true means that the command can't be used from non-interactive user interface */ changelayer, false, /* true means that the command can't be used from non-interactive user interface */

@ -57,7 +57,6 @@ DFHACK_PLUGIN("cursecheck");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("cursecheck", commands.push_back(PluginCommand("cursecheck",
"Checks for cursed creatures (vampires, necromancers, zombies, ...).", "Checks for cursed creatures (vampires, necromancers, zombies, ...).",
cursecheck, false )); cursecheck, false ));

@ -56,7 +56,6 @@ DFHACK_PLUGIN("regrass");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector<PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector<PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("regrass", "Regrows all surface grass, restoring outdoor plant growth for pre-0.31.19 worlds.", df_regrass)); commands.push_back(PluginCommand("regrass", "Regrows all surface grass, restoring outdoor plant growth for pre-0.31.19 worlds.", df_regrass));
return CR_OK; return CR_OK;
} }

@ -96,7 +96,6 @@ DFHACK_PLUGIN("feature");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"feature", "List or manage map features.", feature, false, "feature", "List or manage map features.", feature, false,
" feature list\n" " feature list\n"

@ -57,7 +57,6 @@ DFHACK_PLUGIN("liquids");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
liquids_hist.load("liquids.history"); liquids_hist.load("liquids.history");
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"liquids", "Place magma, water or obsidian.", "liquids", "Place magma, water or obsidian.",
df_liquids, true)); // interactive, needs console for prompt df_liquids, true)); // interactive, needs console for prompt

@ -30,7 +30,6 @@ DFHACK_PLUGIN("mapexport");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
GOOGLE_PROTOBUF_VERIFY_VERSION; GOOGLE_PROTOBUF_VERIFY_VERSION;
commands.clear();
commands.push_back(PluginCommand("mapexport", "Exports the current map to a file.", mapexport, true)); commands.push_back(PluginCommand("mapexport", "Exports the current map to a file.", mapexport, true));
return CR_OK; return CR_OK;
} }

@ -18,7 +18,6 @@ DFHACK_PLUGIN("mode");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"mode","View, change and track game mode.", "mode","View, change and track game mode.",
mode, true, mode, true,

@ -28,7 +28,6 @@ DFHACK_PLUGIN("plants");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("grow", "Grows saplings into trees (with active cursor, only the targetted one).", df_grow)); commands.push_back(PluginCommand("grow", "Grows saplings into trees (with active cursor, only the targetted one).", df_grow));
commands.push_back(PluginCommand("immolate", "Set plants on fire (under cursor, 'shrubs', 'trees' or 'all').", df_immolate)); commands.push_back(PluginCommand("immolate", "Set plants on fire (under cursor, 'shrubs', 'trees' or 'all').", df_immolate));
commands.push_back(PluginCommand("extirpate", "Kill plants (same mechanics as immolate).", df_extirpate)); commands.push_back(PluginCommand("extirpate", "Kill plants (same mechanics as immolate).", df_extirpate));

@ -41,7 +41,6 @@ DFHACK_PLUGIN("probe");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("probe", commands.push_back(PluginCommand("probe",
"A tile probe", "A tile probe",
df_probe)); df_probe));

@ -195,7 +195,6 @@ DFHACK_PLUGIN("prospector");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"prospect", "Show stats of available raw resources.", "prospect", "Show stats of available raw resources.",
prospector, false, prospector, false,

@ -38,7 +38,6 @@ DFHACK_PLUGIN("rename");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (world && ui) { if (world && ui) {
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"rename", "Rename various things.", rename, false, "rename", "Rename various things.", rename, false,

@ -76,7 +76,6 @@ DFHACK_PLUGIN("reveal");
DFhackCExport command_result plugin_init ( color_ostream &out, vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("reveal","Reveal the map. 'reveal hell' will also reveal hell. 'reveal demon' won't pause.",reveal)); commands.push_back(PluginCommand("reveal","Reveal the map. 'reveal hell' will also reveal hell. 'reveal demon' won't pause.",reveal));
commands.push_back(PluginCommand("unreveal","Revert the map to its previous state.",unreveal)); commands.push_back(PluginCommand("unreveal","Revert the map to its previous state.",unreveal));
commands.push_back(PluginCommand("revtoggle","Reveal/unreveal depending on state.",revtoggle)); commands.push_back(PluginCommand("revtoggle","Reveal/unreveal depending on state.",revtoggle));

@ -243,7 +243,6 @@ DFHACK_PLUGIN("seedwatch");
DFhackCExport command_result plugin_init(color_ostream &out, vector<PluginCommand>& commands) DFhackCExport command_result plugin_init(color_ostream &out, vector<PluginCommand>& commands)
{ {
commands.clear();
commands.push_back(PluginCommand("seedwatch", "Switches cookery based on quantity of seeds, to keep reserves", df_seedwatch)); commands.push_back(PluginCommand("seedwatch", "Switches cookery based on quantity of seeds, to keep reserves", df_seedwatch));
// fill in the abbreviations map, with abbreviations for the standard plants // fill in the abbreviations map, with abbreviations for the standard plants
abbreviations["bs"] = "SLIVER_BARB"; abbreviations["bs"] = "SLIVER_BARB";

@ -272,7 +272,6 @@ DFHACK_PLUGIN("showmood");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector<PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector<PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("showmood", "Shows items needed for current strange mood.", df_showmood)); commands.push_back(PluginCommand("showmood", "Shows items needed for current strange mood.", df_showmood));
return CR_OK; return CR_OK;
} }

@ -29,7 +29,6 @@ DFHACK_PLUGIN("skeleton");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
// Fill the command list with your commands. // Fill the command list with your commands.
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"skeleton", "Do nothing, look pretty.", "skeleton", "Do nothing, look pretty.",
skeleton, false, /* true means that the command can't be used from non-interactive user interface */ skeleton, false, /* true means that the command can't be used from non-interactive user interface */

@ -29,7 +29,6 @@ DFHACK_PLUGIN("stockpiles");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (world && ui) { if (world && ui) {
commands.push_back( commands.push_back(
PluginCommand( PluginCommand(

@ -497,7 +497,6 @@ DFHACK_PLUGIN("tiletypes");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
tiletypes_hist.load("tiletypes.history"); tiletypes_hist.load("tiletypes.history");
commands.clear();
commands.push_back(PluginCommand("tiletypes", "Paint map tiles freely, similar to liquids.", df_tiletypes, true)); commands.push_back(PluginCommand("tiletypes", "Paint map tiles freely, similar to liquids.", df_tiletypes, true));
return CR_OK; return CR_OK;
} }

@ -23,7 +23,6 @@ DFHACK_PLUGIN("tubefill");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("tubefill","Fill in all the adamantine tubes again.",tubefill)); commands.push_back(PluginCommand("tubefill","Fill in all the adamantine tubes again.",tubefill));
return CR_OK; return CR_OK;
} }

@ -41,7 +41,6 @@ DFHACK_PLUGIN("tweak");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"tweak", "Various tweaks for minor bugs.", tweak, false, "tweak", "Various tweaks for minor bugs.", tweak, false,
" tweak clear-missing\n" " tweak clear-missing\n"

@ -27,7 +27,6 @@ DFHACK_PLUGIN("vdig");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"vdig","Dig a whole vein.",vdig,Gui::cursor_hotkey, "vdig","Dig a whole vein.",vdig,Gui::cursor_hotkey,
" Designates a whole vein under the cursor for digging.\n" " Designates a whole vein under the cursor for digging.\n"

@ -46,7 +46,6 @@ DFTileSurface* createTile(int x, int y)
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("versionosd", commands.push_back(PluginCommand("versionosd",
"Toggles displaying version in DF window", "Toggles displaying version in DF window",
df_versionosd)); df_versionosd));

@ -19,7 +19,6 @@ DFHACK_PLUGIN("weather");
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"weather", "Print the weather map or change weather.", "weather", "Print the weather map or change weather.",
weather, false, weather, false,

@ -59,7 +59,6 @@ DFHACK_PLUGIN("workflow");
DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (!world || !ui) if (!world || !ui)
return CR_FAILURE; return CR_FAILURE;