bug fixes

This commit is contained in:
Dominic Bolin 2006-04-01 19:49:04 +00:00
parent c6492d3ea2
commit b83be29f0a

View file

@ -922,12 +922,14 @@ void unit::read(const config& cfg)
movement_ = 0;
}
}
if(cfg["hitpoints"] != "") {
hit_points_ = lexical_cast_default<int>(cfg["hitpoints"]);
}
if(cfg["max_hitpoints"] != "") {
max_hit_points_ = lexical_cast_default<int>(cfg["max_hitpoints"]);
}
if(cfg["hitpoints"] != "") {
hit_points_ = lexical_cast_default<int>(cfg["hitpoints"]);
} else {
hit_points_ = max_hit_points_;
}
goto_.x = lexical_cast_default<int>(cfg["goto_x"]) - 1;
goto_.y = lexical_cast_default<int>(cfg["goto_y"]) - 1;
if(cfg["moves"] != "") {
@ -940,9 +942,7 @@ void unit::read(const config& cfg)
if(cfg["max_moves"] != "") {
max_movement_ = lexical_cast_default<int>(cfg["max_moves"]);
}
if(cfg["experience"] != "") {
experience_ = lexical_cast_default<int>(cfg["experience"]);
}
experience_ = lexical_cast_default<int>(cfg["experience"]);
if(cfg["max_experience"] != "") {
max_experience_ = lexical_cast_default<int>(cfg["max_experience"]);
}