Modify setFrozen behavior (#395)

This commit is contained in:
nlog 2023-02-26 05:59:04 +09:00 committed by GitHub
parent 631c409f79
commit b9a3c2849a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,8 +109,13 @@ public Predicate<Vector2i> getTileFilter() {
@Override
public synchronized void setFrozen(boolean frozen) {
if (isFrozen()) unfreeze();
else freeze();
if (frozen != isFrozen()) {
if (frozen) {
freeze();
} else {
unfreeze();
}
}
}
private synchronized void unfreeze() {