mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +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,8 +48,13 @@ public class NetworkedReferenceSet<T> {
|
|||
public boolean clear() {
|
||||
dirty |= !ids.isEmpty() || !values.isEmpty();
|
||||
ids.clear();
|
||||
for (NetworkedReference<T> reference : values.values()) {
|
||||
reference.updateReference(null);
|
||||
try {
|
||||
reading = true;
|
||||
for (NetworkedReference<T> reference : values.values()) {
|
||||
reference.updateReference(null);
|
||||
}
|
||||
} finally {
|
||||
reading = false;
|
||||
}
|
||||
values.clear();
|
||||
return dirty;
|
||||
|
@ -81,7 +86,12 @@ public class NetworkedReferenceSet<T> {
|
|||
NetworkedReference<T> i = values.remove(id);
|
||||
if (i != null) {
|
||||
dirty = true;
|
||||
i.updateReference(null);
|
||||
try {
|
||||
reading = true;
|
||||
i.updateReference(null);
|
||||
} finally {
|
||||
reading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue