Fixed modification exception being thrown when destroying items within a container

This commit is contained in:
Waverunner
2015-06-10 15:25:19 -04:00
parent fbbcf84c2d
commit fe2de9661c
+5 -3
View File
@@ -260,9 +260,11 @@ public class ObjectManager extends Manager {
destroyObject(slottedObj);
}
for (SWGObject containedObj : object.getContainedObjects()) {
if (containedObj != null)
destroyObject(containedObj);
Iterator<SWGObject> containerIterator = object.getContainedObjects().iterator();
while(containerIterator.hasNext()) {
SWGObject containedObject = containerIterator.next();
if (containedObject != null)
destroyObject(containedObject);
}
// Remove object from the parent