1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-11 18:00:34 +00:00

fixed value_set

This commit is contained in:
Zeno Rogue 2020-03-07 13:23:57 +01:00
parent 15864644df
commit 92f682596e

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;