bug fixes
This commit is contained in:
parent
c6492d3ea2
commit
b83be29f0a
1 changed files with 6 additions and 6 deletions
12
src/unit.cpp
12
src/unit.cpp
|
@ -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"]);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue