mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-28 13:12:54 -04:00
fixed #325, fixed ai warping to 0 0 0
This commit is contained in:
@@ -174,7 +174,7 @@ public class SimulationService implements INetworkDispatch {
|
||||
public void insertSnapShotObjects() {
|
||||
List<SWGObject> objectList = new ArrayList<SWGObject>(core.objectService.getObjectList().values());
|
||||
for(SWGObject obj : objectList) {
|
||||
if(obj.getParentId() == 0 && (obj.isInSnapshot() || obj.getAttachment("isBuildout") != null))
|
||||
if(obj.getParentId() == 0 && /*(*/obj.isInSnapshot() /*|| obj.getAttachment("isBuildout") != null)*/)
|
||||
add(obj, obj.getPosition().x, obj.getPosition().z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public abstract class AIState {
|
||||
Point3D newPosition = new Point3D();
|
||||
boolean foundNewPos = findNewPosition(actor, speed, maxDistance, newPosition);
|
||||
|
||||
if(!foundNewPos)
|
||||
if(!foundNewPos || (newPosition.x == 0 && newPosition.z == 0))
|
||||
return;
|
||||
|
||||
Point3D newWorldPos = newPosition.getWorldPosition();
|
||||
|
||||
@@ -176,9 +176,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
public void loadServerTemplates() {
|
||||
System.out.println("Loading server templates...");
|
||||
for(Runnable r : loadServerTemplateTasks) {
|
||||
r.run();
|
||||
}
|
||||
loadServerTemplateTasks.forEach(Runnable::run);
|
||||
loadServerTemplateTasks.clear();
|
||||
System.out.println("Finished loading server templates...");
|
||||
}
|
||||
@@ -882,8 +880,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
if (duplicate.containsKey(containerId)) {
|
||||
containerId = duplicate.get(containerId);
|
||||
}
|
||||
|
||||
if (objectId != 0 && getObject(objectId) != null) {
|
||||
String planetName = planet.getName();
|
||||
if (objectId != 0 && getObject(objectId) != null && (planetName.contains("dungeon") || planetName.contains("adventure"))) {
|
||||
SWGObject container = getObject(containerId);
|
||||
int x = ((int) (px + ((container == null) ? x1 : container.getPosition().x)));
|
||||
int z = ((int) (pz + ((container == null) ? z1 : container.getPosition().z)));
|
||||
@@ -907,6 +905,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
SWGObject object;
|
||||
if(objectId != 0 && containerId == 0) {
|
||||
if(portalCRC != 0) {
|
||||
if (core.getBuildingODB().contains(objectId, Long.class, BuildingObject.class) && !duplicate.containsValue(objectId))
|
||||
continue;
|
||||
containers.add(objectId);
|
||||
object = createObject(template, objectId, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz), null, true, false);
|
||||
object.setAttachment("childObjects", null);
|
||||
@@ -960,6 +960,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
building.createTransaction(core.getBuildingODB().getEnvironment());
|
||||
core.getBuildingODB().put(building, Long.class, BuildingObject.class, building.getTransaction());
|
||||
building.getTransaction().commitSync();
|
||||
destroyObject(building);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user