fixed value_set

This commit is contained in:
Zeno Rogue 2020-03-07 13:23:57 +01:00
parent 15864644df
commit 92f682596e
1 changed files with 2 additions and 1 deletions

View File

@ -447,7 +447,8 @@ struct changes_t {
}
template<class T> void value_set(T& what, T value) {
if(what == value || !on) return;
if(!on) { what = value; return; }
if(what == value) return;
T old = what;
rollbacks.push_back([&what, old] { what = old; });
what = value;