Undo resilient snapshot load breakage caused by 2006-01-26T15:57:56Z!dominic.bolin@exong.net,
...and finally close bug #4962 good and dead. (Resilient adds 10%, then 3hp. hitpoints_ gets reduced to maxHitpoints_ after the first effect, leaving us 3hp short).
This commit is contained in:
parent
560ebbe173
commit
e2b9d54c77
1 changed files with 6 additions and 6 deletions
12
src/unit.cpp
12
src/unit.cpp
|
@ -840,18 +840,18 @@ void unit::read(const game_data& data, const config& cfg)
|
|||
variables_.clear();
|
||||
}
|
||||
|
||||
const std::string& hitpoints = cfg["hitpoints"];
|
||||
hitpoints_ = lexical_cast_default<int>(hitpoints,maxHitpoints_);
|
||||
|
||||
// Set this to some sane value: add_modification clamps it when
|
||||
// altering maxHitpoints_, and if we don't set it valgrind
|
||||
// complains. We actually set it below once maxHitpoints_ is stable.
|
||||
hitpoints_ = 1;
|
||||
const config* const modifications = cfg.child("modifications");
|
||||
if(modifications != NULL) {
|
||||
modifications_ = *modifications;
|
||||
apply_modifications();
|
||||
}
|
||||
|
||||
if(hitpoints == "") {
|
||||
hitpoints_ = maxHitpoints_;
|
||||
}
|
||||
const std::string& hitpoints = cfg["hitpoints"];
|
||||
hitpoints_ = lexical_cast_default<int>(hitpoints,maxHitpoints_);
|
||||
|
||||
goto_.x = atoi(cfg["goto_x"].c_str()) - 1;
|
||||
goto_.y = atoi(cfg["goto_y"].c_str()) - 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue