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:
Dominic Bolin 2006-06-11 21:55:11 +00:00
parent cadf41ee20
commit 303fc9c842

View file

@ -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 {