From 1e74387d3d9291958ce1611e2225a9cd03725050 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 18 Aug 2015 11:16:38 -0400 Subject: [PATCH] Handle case of default (-1) in [effect]apply_to=vision --- src/unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unit.cpp b/src/unit.cpp index 1051a811e39..cb17fa669be 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -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_);