Update xml, scripts, change unit_action.data field names back

Fixes #1520
Makes part of dfhack/scripts#130 unnecessary
develop
lethosor 2020-03-30 03:00:41 -04:00
parent ef51996a2c
commit 9b1dddc336
4 changed files with 25 additions and 25 deletions

@ -1 +1 @@
Subproject commit bd41e0fb3162e317530c1a28f76f1de0a4c8d7cf Subproject commit 37415475903f0d524d19c50b4be057a481554af7

@ -123,55 +123,55 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
case unit_action_type::None: case unit_action_type::None:
break; break;
case unit_action_type::Move: case unit_action_type::Move:
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 // Attacks are executed when timer1 reaches zero, which will be
// on the following tick. // on the following tick.
if (action->data.Attack.timer1 > 1) if (action->data.attack.timer1 > 1)
action->data.Attack.timer1 = 1; action->data.attack.timer1 = 1;
// Attack actions are completed, and new ones generated, when // Attack actions are completed, and new ones generated, when
// timer2 reaches zero. // timer2 reaches zero.
if (action->data.Attack.timer2 > 1) if (action->data.attack.timer2 > 1)
action->data.Attack.timer2 = 1; action->data.attack.timer2 = 1;
break; break;
case unit_action_type::HoldTerrain: case unit_action_type::HoldTerrain:
action->data.HoldTerrain.timer = 1; action->data.holdterrain.timer = 1;
break; break;
case unit_action_type::Climb: case unit_action_type::Climb:
action->data.Climb.timer = 1; action->data.climb.timer = 1;
break; break;
case unit_action_type::Job: case unit_action_type::Job:
action->data.Job.timer = 1; action->data.job.timer = 1;
// could also patch the unit->job.current_job->completion_timer // could also patch the unit->job.current_job->completion_timer
break; break;
case unit_action_type::Talk: case unit_action_type::Talk:
action->data.Talk.timer = 1; action->data.talk.timer = 1;
break; break;
case unit_action_type::Unsteady: case unit_action_type::Unsteady:
action->data.Unsteady.timer = 1; action->data.unsteady.timer = 1;
break; break;
case unit_action_type::Dodge: case unit_action_type::Dodge:
action->data.Dodge.timer = 1; action->data.dodge.timer = 1;
break; break;
case unit_action_type::Recover: case unit_action_type::Recover:
action->data.Recover.timer = 1; action->data.recover.timer = 1;
break; break;
case unit_action_type::StandUp: case unit_action_type::StandUp:
action->data.StandUp.timer = 1; action->data.standup.timer = 1;
break; break;
case unit_action_type::LieDown: case unit_action_type::LieDown:
action->data.LieDown.timer = 1; action->data.liedown.timer = 1;
break; break;
case unit_action_type::Job2: case unit_action_type::Job2:
action->data.Job2.timer = 1; action->data.job2.timer = 1;
// could also patch the unit->job.current_job->completion_timer // could also patch the unit->job.current_job->completion_timer
break; break;
case unit_action_type::PushObject: case unit_action_type::PushObject:
action->data.PushObject.timer = 1; action->data.pushobject.timer = 1;
break; break;
case unit_action_type::SuckBlood: case unit_action_type::SuckBlood:
action->data.SuckBlood.timer = 1; action->data.suckblood.timer = 1;
break; break;
case unit_action_type::Jump: case unit_action_type::Jump:
case unit_action_type::ReleaseTerrain: case unit_action_type::ReleaseTerrain:

@ -1825,17 +1825,17 @@ static command_result GetUnitListInside(color_ostream &stream, const BlockReques
case unit_action_type::Move: case unit_action_type::Move:
if (unit->path.path.x.size() > 0) if (unit->path.path.x.size() > 0)
{ {
send_unit->set_subpos_x(lerp(0, unit->path.path.x[0] - unit->pos.x, (float)(action->data.Move.timer_init - action->data.Move.timer) / action->data.Move.timer_init)); send_unit->set_subpos_x(lerp(0, unit->path.path.x[0] - unit->pos.x, (float)(action->data.move.timer_init - action->data.move.timer) / action->data.move.timer_init));
send_unit->set_subpos_y(lerp(0, unit->path.path.y[0] - unit->pos.y, (float)(action->data.Move.timer_init - action->data.Move.timer) / action->data.Move.timer_init)); send_unit->set_subpos_y(lerp(0, unit->path.path.y[0] - unit->pos.y, (float)(action->data.move.timer_init - action->data.move.timer) / action->data.move.timer_init));
send_unit->set_subpos_z(lerp(0, unit->path.path.z[0] - unit->pos.z, (float)(action->data.Move.timer_init - action->data.Move.timer) / action->data.Move.timer_init)); send_unit->set_subpos_z(lerp(0, unit->path.path.z[0] - unit->pos.z, (float)(action->data.move.timer_init - action->data.move.timer) / action->data.move.timer_init));
} }
break; break;
case unit_action_type::Job: case unit_action_type::Job:
{ {
auto facing = send_unit->mutable_facing(); auto facing = send_unit->mutable_facing();
facing->set_x(action->data.Job.x - unit->pos.x); facing->set_x(action->data.job.x - unit->pos.x);
facing->set_y(action->data.Job.y - unit->pos.y); facing->set_y(action->data.job.y - unit->pos.y);
facing->set_z(action->data.Job.z - unit->pos.z); facing->set_z(action->data.job.z - unit->pos.z);
} }
default: default:
break; break;

@ -1 +1 @@
Subproject commit 15ad8985257dc6b3ed84451d59df66a6fc8ed85f Subproject commit 688b7845eabe7e3ea0dd91b97ee3ba7131ad0903