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:
parent
6b330e2e41
commit
6711f50f1a
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue