Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarInput.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-05-14 13:13:23 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-05-14 13:13:23 +1000
commit21c0682e3f98ee8afacff7be90828b05bc6ccb60 (patch)
tree5a256787d1080809f57aeb5fb295e03f8a426b8b /source/game/StarInput.cpp
parenta840f75d41be4765a476b1043b6a38f350d800e6 (diff)
fix underflow on input clipboard allow state
Diffstat (limited to 'source/game/StarInput.cpp')
-rw-r--r--source/game/StarInput.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/game/StarInput.cpp b/source/game/StarInput.cpp
index d47045d..dec6705 100644
--- a/source/game/StarInput.cpp
+++ b/source/game/StarInput.cpp
@@ -688,7 +688,10 @@ unsigned Input::getTag(String const& tagName) const {
Input::ClipboardUnlock::ClipboardUnlock(Input& input)
: m_input(&input) { ++m_input->m_clipboardAllowed; };
-Input::ClipboardUnlock::~ClipboardUnlock() { --m_input->m_clipboardAllowed; };
+Input::ClipboardUnlock::ClipboardUnlock(ClipboardUnlock&& other) { m_input = take(other.m_input); };
+
+Input::ClipboardUnlock::~ClipboardUnlock() { if (m_input) --m_input->m_clipboardAllowed; };
+
Input::ClipboardUnlock Input::unlockClipboard() {
return Input::ClipboardUnlock(*this);