Advanced settings noiseparams: Remove '}' left in .conf
authorSmallJoker <mk939@ymail.com>
Thu, 10 Jan 2019 17:54:10 +0000 (18:54 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sat, 19 Jan 2019 18:31:41 +0000 (18:31 +0000)
Previously, when editing noiseparams then restoring them to the default,
the final '}' was not removed from minetest.conf.

src/settings.cpp

index 4dd72a4f4737777f1c03b1455e56c637466a5cb0..66c17e12d3c4aa8e56175f72a2b363a71be946c9 100644 (file)
@@ -249,6 +249,9 @@ bool Settings::updateConfigObject(std::istream &is, std::ostream &os,
                        } else if (it == m_settings.end()) {
                                // Remove by skipping
                                was_modified = true;
+                               Settings removed_group; // Move 'is' to group end
+                               std::stringstream ss;
+                               removed_group.updateConfigObject(is, ss, "}", tab_depth + 1);
                                break;
                        } else {
                                printEntry(os, name, it->second, tab_depth);