apply patch #1668 by kevg, saving unit status in savefile

This commit is contained in:
Jérémy Rosen 2010-05-11 20:11:56 +00:00
parent 26b5e90873
commit d61e77efc7
2 changed files with 4 additions and 6 deletions

View File

@ -114,6 +114,7 @@ Version 1.9.0-svn:
* Fixed tab completion not working in the new lobby (bug #14730)
* Fixed compilation for g++ 4.5
* Cleaned up the gui2 code at various places
* Fixed restoring and saving unit statuses (bug #15889)
* Music and sound effects
* New version of "Northerners" by Stephen Rozanc (TreizeCouleurs)

View File

@ -439,8 +439,8 @@ unit::unit(const config &cfg, bool use_traits, game_state* state) :
"support will be removed in 1.9.2.\n";
if (!utils::string_bool(st.second, true))
set_state("unhealable", true);
} else if (utils::string_bool(st.second)) {
set_state(st.first, true);
} else {
set_state(st.first, utils::string_bool(st.second));
}
}
cfg_.clear_children("status");
@ -1106,10 +1106,7 @@ const std::map<std::string,std::string> unit::get_states() const
for (std::map<std::string, state_t>::const_iterator i = known_boolean_state_names_.begin(),
i_end = known_boolean_state_names_.end(); i != i_end; ++i)
{
if (get_state(i->second)) {
all_states.insert(make_pair(i->first, "yes" ));
}
all_states[i->first] = get_state(i->second) ? "yes" : "no";
}
return all_states;
}