Follow changes in the xml defs.

develop
Alexander Gavrilov 2012-11-17 16:43:29 +04:00
parent 1ab48aa2de
commit 0b568942f4
2 changed files with 7 additions and 6 deletions

@ -1 +1 @@
Subproject commit 9b4dc47a54c8b15db2f30fbf926deb8c1bf992f6 Subproject commit 111ba2297edb13a60f17e0b8ebc786c56df9c45f

@ -713,7 +713,7 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
{ {
// Sparring has a problem in that all of its participants decrement // Sparring has a problem in that all of its participants decrement
// the countdown variable. Fix this by multiplying it by the member count. // the countdown variable. Fix this by multiplying it by the member count.
sp->countdown = sp->countdown * sp->participants.hist_figure_ids.size(); sp->countdown = sp->countdown * sp->participants.units.size();
} }
else if (auto sd = strict_virtual_cast<df::activity_event_skill_demonstrationst>(event)) else if (auto sd = strict_virtual_cast<df::activity_event_skill_demonstrationst>(event))
{ {
@ -722,7 +722,7 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
sd->wait_countdown = adjust_unit_divisor(sd->wait_countdown); sd->wait_countdown = adjust_unit_divisor(sd->wait_countdown);
// Check if the game selected the most skilled unit as the teacher // Check if the game selected the most skilled unit as the teacher
auto &units = sd->participants.participant_ids; auto &units = sd->participants.units;
int maxv = -1, cur_xp = -1, minv = 0; int maxv = -1, cur_xp = -1, minv = 0;
int best = -1; int best = -1;
size_t spar = 0; size_t spar = 0;
@ -775,7 +775,7 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
out.print("Replacing teacher %d (%d xp) with %d (%d xp)\n", out.print("Replacing teacher %d (%d xp) with %d (%d xp)\n",
sd->unit_id, cur_xp, units[best], maxv); sd->unit_id, cur_xp, units[best], maxv);
sd->hist_figure_id = sd->participants.hist_figure_ids[best]; sd->hist_figure_id = sd->participants.histfigs[best];
sd->unit_id = units[best]; sd->unit_id = units[best];
} }
} }
@ -806,10 +806,11 @@ struct military_training_sd_hook : df::activity_event_skill_demonstrationst {
IMPLEMENT_VMETHOD_INTERPOSE(military_training_sd_hook, process); IMPLEMENT_VMETHOD_INTERPOSE(military_training_sd_hook, process);
static bool is_done(df::activity_event *event, df::unit *unit) template<class T>
bool is_done(T *event, df::unit *unit)
{ {
return event->flags.bits.dismissed || return event->flags.bits.dismissed ||
binsearch_index(event->participants.participant_ids, unit->id) < 0; binsearch_index(event->participants.units, unit->id) < 0;
} }
struct military_training_sp_hook : df::activity_event_sparringst { struct military_training_sp_hook : df::activity_event_sparringst {