Fix ability to edit nonexistent terrain types

This commit is contained in:
2015-08-19 15:42:49 -04:00
parent 2996ab39bb
commit 6bd7987ff3

View File

@@ -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();