From 180ff44bd4de32cf5066233ea196851ad40dc9c5 Mon Sep 17 00:00:00 2001 From: Obique PSWG Date: Sun, 7 Jun 2015 11:50:44 -0500 Subject: [PATCH] Added an additional function to ObjectManager to allow creating objects without adding them to awareness --- src/services/objects/ObjectManager.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/objects/ObjectManager.java b/src/services/objects/ObjectManager.java index c7d374a9..5bdcf234 100644 --- a/src/services/objects/ObjectManager.java +++ b/src/services/objects/ObjectManager.java @@ -288,7 +288,15 @@ public class ObjectManager extends Manager { return createObject(template, null); } + public SWGObject createObject(String template, boolean addToAwareness) { + return createObject(template, null, addToAwareness); + } + public SWGObject createObject(String template, Location l) { + return createObject(template, l, true); + } + + public SWGObject createObject(String template, Location l, boolean addToAwareness) { synchronized (objects) { long objectId = getNextObjectId(); SWGObject obj = ObjectCreator.createObjectFromTemplate(objectId, template); @@ -297,7 +305,9 @@ public class ObjectManager extends Manager { return null; } obj.setLocation(l); - objectAwareness.add(obj); + if (addToAwareness) { + objectAwareness.add(obj); + } objects.put(objectId, obj); Log.i("ObjectManager", "Created object %d [%s]", obj.getObjectId(), obj.getTemplate()); return obj;