From 6bd7987ff3ab45c3d442e9eb19b56cb7d537cf3b Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 19 Aug 2015 15:42:49 -0400 Subject: [PATCH] Fix ability to edit nonexistent terrain types --- src/scenedit/scen.actions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index d744b849..124170c8 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -1208,6 +1208,7 @@ static bool handle_terpal_action(location cur_point, bool option_hit) { else { short size_before = scenario.ter_types.size(), pos_before = pal_sbar->getPosition(); i += pos_before * 16; + if(i > size_before) return true; if(option_hit) { if(i == size_before - 1 && !scenario.is_ter_used(i)) scenario.ter_types.pop_back();