mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 10:20:30 +00:00
Handle case of default (-1) in [effect]apply_to=vision
This commit is contained in:
parent
69006cbf14
commit
1e74387d3d
@ -1791,7 +1791,8 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
|
||||
t_string(N_("vision"), "wesnoth");
|
||||
}
|
||||
|
||||
vision_ = utils::apply_modifier(vision_, increase, 1);
|
||||
const int current_vision = vision_ < 0 ? max_movement_ : vision_;
|
||||
vision_ = utils::apply_modifier(current_vision, increase, 1);
|
||||
}
|
||||
|
||||
vision_ = effect["set"].to_int(vision_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user