mirror of
https://bitbucket.org/projectswg/cucore.git
synced 2026-07-31 00:15:48 -04:00
Added character deletion
This commit is contained in:
@@ -137,6 +137,24 @@ public class ObjectManager extends Manager {
|
||||
}
|
||||
}
|
||||
|
||||
public SWGObject deleteObject(long objId) {
|
||||
synchronized (objects) {
|
||||
SWGObject obj = objects.remove(objId);
|
||||
if (obj == null)
|
||||
return null;
|
||||
Location loc = obj.getLocation();
|
||||
if (loc != null && loc.getTerrain() != null)
|
||||
quadTree.get(loc.getTerrain()).remove(loc.getX(), loc.getZ(), obj);
|
||||
for (SWGObject child : obj.getChildren())
|
||||
if (child != null)
|
||||
deleteObject(child.getObjectId());
|
||||
for (SWGObject slot : obj.getSlots().values())
|
||||
if (slot != null)
|
||||
deleteObject(slot.getObjectId());
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
public SWGObject createObject(String template) {
|
||||
return createObject(template, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user