mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-31 01:15:57 -04:00
Fixed crash caused by buildings, fixed weapon object superclass, added equipment and appearance equipment deltas
This commit is contained in:
@@ -46,6 +46,7 @@ import engine.clients.Client;
|
||||
import engine.resources.common.Event;
|
||||
import engine.resources.common.Mesh3DTriangle;
|
||||
import engine.resources.common.Ray;
|
||||
import engine.resources.container.Traverser;
|
||||
import engine.resources.objects.SWGObject;
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
@@ -188,8 +189,10 @@ public class SimulationService implements INetworkDispatch {
|
||||
Collection<SWGObject> newAwareObjects = get(object.getPlanet(), x, y, 512);
|
||||
for(Iterator<SWGObject> it = newAwareObjects.iterator(); it.hasNext();) {
|
||||
SWGObject obj = it.next();
|
||||
if(obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance(pos) > 200)
|
||||
if((obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance2D(pos) > 200) || obj == object)
|
||||
continue;
|
||||
//if(!obj.isInSnapshot())
|
||||
// System.out.println(obj.getTemplate());
|
||||
if(object.getClient() != null)
|
||||
object.makeAware(obj);
|
||||
if(obj.getClient() != null)
|
||||
@@ -246,7 +249,8 @@ public class SimulationService implements INetworkDispatch {
|
||||
|
||||
public boolean remove(SWGObject object, float x, float y, boolean notifyObservers) {
|
||||
boolean success = quadTrees.get(object.getPlanet().getName()).remove(x, y, object);
|
||||
if(success) {
|
||||
object.setIsInQuadtree(success);
|
||||
if(success && notifyObservers) {
|
||||
HashSet<Client> oldObservers = new HashSet<Client>(object.getObservers());
|
||||
for(Iterator<Client> it = oldObservers.iterator(); it.hasNext();) {
|
||||
Client observerClient = it.next();
|
||||
@@ -586,12 +590,12 @@ public class SimulationService implements INetworkDispatch {
|
||||
// object.getContainer().remove(object);
|
||||
//}
|
||||
|
||||
core.objectService.destroyObject(object);
|
||||
|
||||
object.createTransaction(core.getCreatureODB().getEnvironment());
|
||||
core.getCreatureODB().put(object, Long.class, CreatureObject.class, object.getTransaction());
|
||||
object.getTransaction().commitSync();
|
||||
|
||||
core.objectService.destroyObject(object);
|
||||
core.getActiveConnectionsMap().remove((Integer) session.getAttribute("connectionId"));
|
||||
|
||||
}
|
||||
@@ -612,8 +616,9 @@ public class SimulationService implements INetworkDispatch {
|
||||
Collection<SWGObject> newAwareObjects = get(object.getPlanet(), pos.x, pos.z, 512);
|
||||
for(Iterator<SWGObject> it = newAwareObjects.iterator(); it.hasNext();) {
|
||||
SWGObject obj = it.next();
|
||||
if(obj.getAttachment("bigSpawnRange") == null & obj.getWorldPosition().getDistance(pos) > 200)
|
||||
if(obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance(pos) > 200)
|
||||
continue;
|
||||
System.out.println(obj.getTemplate());
|
||||
object.makeAware(obj);
|
||||
if(obj.getClient() != null)
|
||||
obj.makeAware(object);
|
||||
@@ -689,7 +694,6 @@ public class SimulationService implements INetworkDispatch {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void openContainer(SWGObject requester, SWGObject container) {
|
||||
|
||||
if(container.getPermissions().canView(requester, container)) {
|
||||
|
||||
Reference in New Issue
Block a user