From ab21c0551c6f5c3ccb63f6f2670a5f39c2c4294a Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 10 May 2015 13:34:45 +1000 Subject: [PATCH] Provide a default encoding when changing to "Function". --- apps/opencs/model/world/nestedcoladapterimp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index 8c62fb59b..4c720ba24 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -854,7 +854,14 @@ namespace CSMWorld { // FIXME: when these change the values of the other columns need to change // correspondingly (and automatically) - case 1: conditions[subRowIndex].mSelectRule[1] = '1'; break; // Function + case 1: + { + conditions[subRowIndex].mSelectRule[1] = '1'; // Function + // default to "Rank Low" + conditions[subRowIndex].mSelectRule[2] = '0'; + conditions[subRowIndex].mSelectRule[3] = '0'; + break; + } case 2: conditions[subRowIndex].mSelectRule[1] = '2'; break; // Global case 3: conditions[subRowIndex].mSelectRule[1] = '3'; break; // Local case 4: conditions[subRowIndex].mSelectRule[1] = '4'; break; // Journal @@ -874,7 +881,6 @@ namespace CSMWorld { if (conditions[subRowIndex].mSelectRule[1] == '1') { - // throws an exception if the function is not found const std::map::const_iterator it = sInfoFuncToEnc.find( value.toString().toUtf8().constData()); if (it != sInfoFuncToEnc.end())