Fix for bug #18716 Some recruited/spawned units are slowed on creation.

Units with non-standard attributes were converting those atributes to
an integer, which the attribute_value::to_int function was converting
to 0, which unit::set_state interpreted as STATE_SLOW.  Changed it to
passing a t_token.
This commit is contained in:
Thonsew 2011-09-24 19:03:22 +00:00
parent 6b330e2e41
commit 6711f50f1a

View file

@ -2814,11 +2814,11 @@ void unit::add_modification(const config::t_token& type, const config& mod, bool
const config::attribute_value &remove = effect[z_remove];
if(add.empty() == false) {
set_state(state_t(add.to_int()), true);
set_state(add.token(), true);
}
if(remove.empty() == false) {
set_state(state_t(remove.to_int()), false);
set_state(remove.token(), false);
}
} else if (apply_to == z_movement_costs) {
config &mv = cfg_.child_or_add(z_movement_costs);