From da72848b0b18ca29b5a7f6f4186b325f9b3a8ea9 Mon Sep 17 00:00:00 2001 From: hobotron-df Date: Sat, 27 Sep 2014 19:47:27 -0500 Subject: [PATCH] Fixes for fastdwarf combat speed and attack retargeting. --- plugins/fastdwarf.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/fastdwarf.cpp b/plugins/fastdwarf.cpp index b03fda561..0bd9d9698 100644 --- a/plugins/fastdwarf.cpp +++ b/plugins/fastdwarf.cpp @@ -113,8 +113,15 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out ) action->data.move.timer = 1; break; case unit_action_type::Attack: + // Attacks are executed when timer1 reaches zero, which will be + // on the following tick. action->data.attack.timer1 = 1; - action->data.attack.timer2 = 1; + // Attack actions are completed, and new ones generated, when + // timer2 reaches zero. If set to 1 this never seems to occur. + // Setting to zero makes next tick generate a new attack action + // every time, thereby allowing target enemy/body part re-selection + // take place. + action->data.attack.timer2 = 0; break; case unit_action_type::Hold: action->data.hold.timer = 1;