make sure traits can only be generated...
...after it's certain that the unit's state has been backed up (fixes the cause of bug #6134)
This commit is contained in:
parent
cadf41ee20
commit
303fc9c842
1 changed files with 4 additions and 4 deletions
|
@ -1018,15 +1018,15 @@ void unit::read(const config& cfg)
|
|||
if(cfg["ai_special"] == "guardian") {
|
||||
set_state("guardian","yes");
|
||||
}
|
||||
if(!type_set) {
|
||||
backup_state();
|
||||
apply_modifications();
|
||||
}
|
||||
if(utils::string_bool(cfg["random_traits"]) ||
|
||||
race_->name() == "undead") {
|
||||
generate_traits();
|
||||
cfg_["random_traits"] = "";
|
||||
}
|
||||
if(!type_set) {
|
||||
backup_state();
|
||||
apply_modifications();
|
||||
}
|
||||
if(cfg["hitpoints"] != "") {
|
||||
hit_points_ = lexical_cast_default<int>(cfg["hitpoints"]);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue