From c587ea2c74056b392d004f8e5186c076fe0ed783 Mon Sep 17 00:00:00 2001 From: Quietust Date: Mon, 27 Aug 2012 14:06:10 -0500 Subject: [PATCH] Add new tweak command to make Train orders no longer count as patrol duty --- plugins/tweak.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plugins/tweak.cpp b/plugins/tweak.cpp index 70acf7607..591125c5e 100644 --- a/plugins/tweak.cpp +++ b/plugins/tweak.cpp @@ -28,6 +28,7 @@ #include "df/criminal_case.h" #include "df/unit_inventory_item.h" #include "df/viewscreen_dwarfmodest.h" +#include "df/squad_order_trainst.h" #include @@ -72,6 +73,10 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector ¶meters) { @@ -292,6 +308,14 @@ static command_result tweak(color_ostream &out, vector ¶meters) else hook.apply(); } + else if (cmd == "patrol-duty") + { + auto &hook = INTERPOSE_HOOK(patrol_duty_hook, isPatrol); + if (vector_get(parameters, 1) == "disable") + hook.remove(); + else + hook.apply(); + } else return CR_WRONG_USAGE;