Don't clobber the modified flag when unlocking

This commit is contained in:
Phillip Stephens 2021-06-06 13:37:04 -07:00
parent 73b7ba8414
commit a6076eb5f9
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}
}