From a6076eb5f9df9b07007be092512861d48bf2cf85 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 6 Jun 2021 13:37:04 -0700 Subject: [PATCH] Don't clobber the modified flag when unlocking --- hecl/lib/CVar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hecl/lib/CVar.cpp b/hecl/lib/CVar.cpp index 5b9a958e3..49bb80c74 100644 --- a/hecl/lib/CVar.cpp +++ b/hecl/lib/CVar.cpp @@ -458,7 +458,13 @@ void CVar::unlock() { void CVar::lock() { if (!isReadOnly() && m_unlocked) { + // We want to keep if we've been modified so we can inform our listeners + bool modified = True(m_flags & EFlags::Modified); m_flags = m_oldFlags; + // If we've been modified insert that back into m_flags + if (modified) { + m_flags |= EFlags::Modified; + } m_unlocked = false; } }