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:
parent
15864644df
commit
92f682596e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user