From e249ef1377ba99388ac967a4f76dda4b863d50be Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Thu, 29 Mar 2012 17:14:41 +0200 Subject: [PATCH 1/2] minor fix (forgot a line break in helpstring) --- plugins/changeitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/changeitem.cpp b/plugins/changeitem.cpp index b3fb2debc..dae0d4a6f 100644 --- a/plugins/changeitem.cpp +++ b/plugins/changeitem.cpp @@ -53,7 +53,7 @@ const string changeitem_help = " quality, q - change base quality. must be followed by number (0-5)\n" " force - ignore subtypes, force change to new material.\n" "Example:\n" - " changeitem m INORGANIC:GRANITE here" + " changeitem m INORGANIC:GRANITE here\n" " change material of all items under the cursor to granite\n" " changeitem q 5\n" " change currently selected item to masterpiece quality\n"; @@ -61,7 +61,7 @@ const string changeitem_help = DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { - commands.clear(); + //commands.clear(); commands.push_back(PluginCommand( "changeitem", "Change item attributes (material, quality).", df_changeitem, false, From 836d8de73e84dc8cf69307218478d8639e26f469 Mon Sep 17 00:00:00 2001 From: Robert Heinrich Date: Thu, 29 Mar 2012 17:20:25 +0200 Subject: [PATCH 2/2] minor: commands.clear() is not needed in plugin_init() anymore. (done by pluginManager now) removed some useless comments --- plugins/changeitem.cpp | 1 - plugins/changelayer.cpp | 7 ------- plugins/cursecheck.cpp | 1 - plugins/liquids.cpp | 1 - 4 files changed, 10 deletions(-) diff --git a/plugins/changeitem.cpp b/plugins/changeitem.cpp index dae0d4a6f..b7dd17a06 100644 --- a/plugins/changeitem.cpp +++ b/plugins/changeitem.cpp @@ -61,7 +61,6 @@ const string changeitem_help = DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { - //commands.clear(); commands.push_back(PluginCommand( "changeitem", "Change item attributes (material, quality).", df_changeitem, false, diff --git a/plugins/changelayer.cpp b/plugins/changelayer.cpp index 5f7d5cf0e..d56360d83 100644 --- a/plugins/changelayer.cpp +++ b/plugins/changelayer.cpp @@ -84,11 +84,8 @@ command_result changelayer (color_ostream &out, std::vector & para DFHACK_PLUGIN("changelayer"); -// Mandatory init function. If you have some global state, create it here. DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { - // Fill the command list with your commands. - commands.clear(); commands.push_back(PluginCommand( "changelayer", "Change a whole geology layer.", changelayer, false, /* true means that the command can't be used from non-interactive user interface */ @@ -98,12 +95,8 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { - commands.clear(); commands.push_back(PluginCommand("cursecheck", "Checks for cursed creatures (vampires, necromancers, zombies, ...).", cursecheck, false )); diff --git a/plugins/liquids.cpp b/plugins/liquids.cpp index 5f4d5b4fe..a7483a886 100644 --- a/plugins/liquids.cpp +++ b/plugins/liquids.cpp @@ -57,7 +57,6 @@ DFHACK_PLUGIN("liquids"); DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { liquids_hist.load("liquids.history"); - commands.clear(); commands.push_back(PluginCommand( "liquids", "Place magma, water or obsidian.", df_liquids, true)); // interactive, needs console for prompt