Fixes for fastdwarf combat speed and attack retargeting.

develop
hobotron-df 2014-09-27 19:47:27 -05:00
parent b0b6a82c92
commit da72848b0b
1 changed files with 8 additions and 1 deletions

@ -113,8 +113,15 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
action->data.move.timer = 1; action->data.move.timer = 1;
break; break;
case unit_action_type::Attack: 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.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; break;
case unit_action_type::Hold: case unit_action_type::Hold:
action->data.hold.timer = 1; action->data.hold.timer = 1;