Support for vision in [unit], previously it worked only in [unit_type].

This commit is contained in:
Fabian Müller 2013-01-13 20:00:58 +00:00
parent ed41ff9803
commit 06269beeaf

View file

@ -372,6 +372,8 @@ unit::unit(const config &cfg, bool use_traits, game_state* state, const vconfig*
max_movement_ = std::max(0, cfg["max_moves"].to_int(max_movement_));
max_experience_ = std::max(1, cfg["max_experience"].to_int(max_experience_));
vision_ = cfg["vision"].to_int(vision_);
std::vector<std::string> temp_advances = utils::split(cfg["advances_to"]);
if(temp_advances.size() == 1 && temp_advances.front() == "null") {
advances_to_.clear();