Fix profile not changing when changing unit type by WML

This commit is contained in:
Dominic Bolin 2006-07-14 21:58:45 +00:00
parent bbdc679e74
commit bc8a6f9643

View File

@ -1011,6 +1011,7 @@ void unit::read(const config& cfg)
}
validate_side(side_);
bool id_set = cfg["id"] != "";
/* prevent un-initialized variables */
max_hit_points_=1;
@ -1138,7 +1139,7 @@ void unit::read(const config& cfg)
cfg_["unit_description"] = custom_unit_desc;
}
if(cfg["profile"] != "") {
if(cfg["profile"] != "" && !id_set) {
cfg_["profile"] = cfg["profile"];
}