mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Fixed disguises (spells) not clearing properly when removed by the server #47
This commit is contained in:
parent
6d48b1ad57
commit
66255ad61d
1 changed files with 13 additions and 3 deletions
|
@ -48,9 +48,14 @@ public class NetworkedReferenceSet<T> {
|
||||||
public boolean clear() {
|
public boolean clear() {
|
||||||
dirty |= !ids.isEmpty() || !values.isEmpty();
|
dirty |= !ids.isEmpty() || !values.isEmpty();
|
||||||
ids.clear();
|
ids.clear();
|
||||||
|
try {
|
||||||
|
reading = true;
|
||||||
for (NetworkedReference<T> reference : values.values()) {
|
for (NetworkedReference<T> reference : values.values()) {
|
||||||
reference.updateReference(null);
|
reference.updateReference(null);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
reading = false;
|
||||||
|
}
|
||||||
values.clear();
|
values.clear();
|
||||||
return dirty;
|
return dirty;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +86,12 @@ public class NetworkedReferenceSet<T> {
|
||||||
NetworkedReference<T> i = values.remove(id);
|
NetworkedReference<T> i = values.remove(id);
|
||||||
if (i != null) {
|
if (i != null) {
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
try {
|
||||||
|
reading = true;
|
||||||
i.updateReference(null);
|
i.updateReference(null);
|
||||||
|
} finally {
|
||||||
|
reading = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue