Fix error printed when respawning

This commit is contained in:
Sollace 2024-05-28 14:32:31 +01:00
parent 98714556a0
commit 9efe49afbd
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -59,10 +59,12 @@ public class DataTracker {
synchronized void copyTo(DataTracker destination) { synchronized void copyTo(DataTracker destination) {
for (int i = 0; i < codecs.size(); i++) { for (int i = 0; i < codecs.size(); i++) {
((Pair<Object>)destination.codecs.get(i)).value = codecs.get(i).value; ((Pair<Object>)destination.codecs.get(i)).value = codecs.get(i).value;
TrackableObject<?> a = persistentObjects.get(i); if (i < persistentObjects.size() && i < destination.persistentObjects.size()) {
TrackableObject<?> b = destination.persistentObjects.get(i); TrackableObject<?> a = persistentObjects.get(i);
if (a != null && b != null) { TrackableObject<?> b = destination.persistentObjects.get(i);
((TrackableObject)a).copyTo(b); if (a != null && b != null) {
((TrackableObject)a).copyTo(b);
}
} }
} }
} }