diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 384aa686..2b9df15b 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1997,6 +1997,7 @@ Performance improvements - Increase memory limit 6GB->8GB - Server block chunk disk map writes directly to output stream instead of inbetween buffer - No-allocation block chunk read/write in disk map + - Fix client collidable memory leak Increase human move speed LOD components re-attach physics VectorPool->JomlPool diff --git a/src/main/java/electrosphere/collision/PhysicsEntityUtils.java b/src/main/java/electrosphere/collision/PhysicsEntityUtils.java index a856ca82..5fce4fb0 100644 --- a/src/main/java/electrosphere/collision/PhysicsEntityUtils.java +++ b/src/main/java/electrosphere/collision/PhysicsEntityUtils.java @@ -101,6 +101,7 @@ public class PhysicsEntityUtils { ); rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform); rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate); + rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable); Globals.clientState.clientScene.registerEntityToTag(rVal, EntityTags.COLLIDABLE); engine.registerCollisionObject(geom, collidable); diff --git a/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java b/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java index 5add88c2..ca6d935f 100644 --- a/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java +++ b/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java @@ -55,7 +55,7 @@ public class ClientLODComponent implements BehaviorTree { cachedLodLevel = lodLevel; if(cachedLodLevel == ServerLODComponent.FULL_RES){ CommonEntityType type = CommonEntityUtils.getCommonData(this.parent); - if(type.getCollidable() != null){ + if(type.getCollidable() != null && PhysicsEntityUtils.getCollidable(this.parent) == null){ PhysicsEntityUtils.clientAttachCollidableTemplate(parent, type.getCollidable()); } } else if(cachedLodLevel == ServerLODComponent.LOW_RES){