From 99e89f23a6943f2030a161e59a4b60d522dd6700 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 28 Mar 2020 19:13:02 +0300 Subject: [PATCH 1/2] Fix calculateNpcStatModifiers call for non-NPCs --- apps/openmw/mwmechanics/actors.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 29ed1a7679..8ee248ee55 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1871,7 +1871,8 @@ namespace MWMechanics // Reset dynamic stats, attributes and skills calculateCreatureStatModifiers(iter->first, 0); - calculateNpcStatModifiers(iter->first, 0); + if (iter->first.getClass().isNpc()) + calculateNpcStatModifiers(iter->first, 0); if( iter->first == getPlayer()) { From 69219c18a7b42fd29cbe4d8d30bcbb35edbd3c58 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 28 Mar 2020 19:15:43 +0300 Subject: [PATCH 2/2] Make sure blank lines at the end of settings.cfg don't disappear --- components/settings/parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/settings/parser.cpp b/components/settings/parser.cpp index 1dcb0fd8d6..9693bf5117 100644 --- a/components/settings/parser.cpp +++ b/components/settings/parser.cpp @@ -103,18 +103,18 @@ void Settings::SettingsFileParser::saveSettingsFile(const std::string& file, con // The current character position in the line. size_t i = 0; - // Don't add additional newlines at the end of the file. - if (istream.eof()) continue; - // An empty line was queued. if (emptyLineQueued) { emptyLineQueued = false; // We're still going through the current category, so we should copy it. - if (currentCategory.empty() || line[i] != '[') + if (currentCategory.empty() || istream.eof() || line[i] != '[') ostream << std::endl; } + // Don't add additional newlines at the end of the file otherwise. + if (istream.eof()) continue; + // Queue entirely blank lines to add them if desired. if (!skipWhiteSpace(i, line)) {