From 4b2c73452ccb0604b4513d090c2da68408b426ac Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 25 Oct 2016 08:53:40 +0200 Subject: [PATCH] fix(ramp): Always load ramp fallback values --- include/drawtypes/ramp.hpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/drawtypes/ramp.hpp b/include/drawtypes/ramp.hpp index 6b28a0ea..2372ea06 100644 --- a/include/drawtypes/ramp.hpp +++ b/include/drawtypes/ramp.hpp @@ -44,12 +44,7 @@ namespace drawtypes { inline auto load_ramp(const config& conf, string section, string name, bool required = true) { name = string_util::ltrim(string_util::rtrim(name, '>'), '<'); - icon_t ramp_defaults; - - try { - ramp_defaults = load_icon(conf, section, name); - } catch (const key_error&) { - } + auto ramp_defaults = load_optional_icon(conf, section, name); vector vec; vector icons; @@ -61,10 +56,7 @@ namespace drawtypes { for (size_t i = 0; i < icons.size(); i++) { auto icon = load_optional_icon(conf, section, name + "-" + to_string(i), icons[i]); - - if (ramp_defaults) - icon->copy_undefined(ramp_defaults); - + icon->copy_undefined(ramp_defaults); vec.emplace_back(move(icon)); }