Skip to content

Commit

Permalink
Prevent chests from losing items.
Browse files Browse the repository at this point in the history
  • Loading branch information
portokaliu committed Aug 30, 2017
1 parent 7c923be commit 155c325
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.terasology.network.NetworkComponent;
import org.terasology.physics.components.RigidBodyComponent;
import org.terasology.registry.In;
import org.terasology.rendering.logic.MeshComponent;
import org.terasology.rendering.world.WorldRenderer;

@RegisterSystem(RegisterMode.CLIENT)
Expand Down Expand Up @@ -155,11 +156,9 @@ private void linkHeldItemLocationForLocalPlayer(EntityRef newItem, EntityRef old
if (mountPointComponent != null) {

if (clientHeldItem.exists()) {
clientHeldItem.destroy();
clientHeldItem = EntityRef.NULL;
clientHeldItem.removeComponent(MeshComponent.class);
}


// remove the location from the old item
if (oldItem != null && oldItem.exists()) {
oldItem.removeComponent(ItemIsHeldComponent.class);
Expand Down

0 comments on commit 155c325

Please sign in to comment.