summaryrefslogtreecommitdiff
path: root/src/client/gameui.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-06-10 13:01:07 +0200
committerGitHub <noreply@github.com>2019-06-10 13:01:07 +0200
commite2f8f4da83206d551f9acebd14d574ea37ca214a (patch)
tree0a2a4f63b59db1a511c781c617b5e80f608723e5 /src/client/gameui.cpp
parente40be619f2a30c7a4d5042d922f0fe57539411d5 (diff)
downloadminetest-e2f8f4da83206d551f9acebd14d574ea37ca214a.tar.gz
minetest-e2f8f4da83206d551f9acebd14d574ea37ca214a.tar.bz2
minetest-e2f8f4da83206d551f9acebd14d574ea37ca214a.zip
Formspecs: Close on metadata removal (#8348)
Formspecs will now close as soon the formspec string in the node metadata turns invalid.
Diffstat (limited to 'src/client/gameui.cpp')
-rw-r--r--src/client/gameui.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp
index 5533cd119..f3c3fefb6 100644
--- a/src/client/gameui.cpp
+++ b/src/client/gameui.cpp
@@ -302,3 +302,15 @@ void GameUI::toggleProfiler()
showTranslatedStatusText("Profiler hidden");
}
}
+
+
+void GameUI::deleteFormspec()
+{
+ if (m_formspec)
+ m_formspec->quitMenu();
+
+ delete m_formspec;
+ m_formspec = nullptr;
+
+ m_formname.clear();
+}