diff --git a/docs/plugins/preserve-tombs.rst b/docs/plugins/preserve-tombs.rst index 67e7ceff6..e1d0ba8ce 100644 --- a/docs/plugins/preserve-tombs.rst +++ b/docs/plugins/preserve-tombs.rst @@ -16,7 +16,7 @@ Usage ``preserve-tombs [status]`` check the status of the plugin, and if the plugin is enabled, lists all currently tracked tomb assignments -``preserve-tombs update`` +``preserve-tombs now`` forces an immediate update of the tomb assignments. This plugin automatically updates the tomb assignments once every 100 ticks. diff --git a/plugins/preserve-tombs.cpp b/plugins/preserve-tombs.cpp index 3e5cea1d2..976b6bd22 100644 --- a/plugins/preserve-tombs.cpp +++ b/plugins/preserve-tombs.cpp @@ -98,7 +98,7 @@ static command_result do_command(color_ostream& out, std::vector& p } return CR_OK; } - if (params[0] == "update") { + if (params[0] == "now") { if (!is_enabled) { out.printerr("Cannot update %s when not enabled", plugin_name); return CR_FAILURE; @@ -232,11 +232,9 @@ static void update_tomb_assignments(color_ostream &out) { plugin_name, tomb->assigned_unit_id, tomb->id); } - else { - if (it->second != tomb->id) { - DEBUG(cycle, out).print("%s tomb assignment to %d changed, (old: %d, new: %d)\n", - plugin_name, tomb->assigned_unit_id, it->second, tomb->id); - } + else if (it->second != tomb->id) { + DEBUG(cycle, out).print("%s tomb assignment to %d changed, (old: %d, new: %d)\n", + plugin_name, tomb->assigned_unit_id, it->second, tomb->id); it->second = tomb->id; } @@ -257,7 +255,7 @@ static void update_tomb_assignments(color_ostream &out) { return true; } if (tomb->assigned_unit_id != unit_id) { - DEBUG(cycle, out).print("%s unassigned unit %d from tomb %d - removing\n", plugin_name, unit_id, building_id); + DEBUG(cycle, out).print("%s unit %d unassigned from tomb %d - removing\n", plugin_name, unit_id, building_id); return true; }