]> git.lizzy.rs Git - dragonblocks.git/blobdiff - engine/spawned_entity.js
Remove ids from entities
[dragonblocks.git] / engine / spawned_entity.js
index f2c0635ad596ebb584ba2df4fc6fe0ccdf842540..47969059010b806a628d804337f73897193f60e9 100644 (file)
@@ -29,7 +29,6 @@ dragonblocks.SpawnedEntity = class
                this.tmp = {map};
 
                if (def instanceof dragonblocks.Entity) {
-                       this.id = dragonblocks.getToken();
                        this.jumping = this.movingRight = this.movingLeft = this.movingUp = this.movingDown = false;
                        this.x = x;
                        this.y = y;
@@ -85,9 +84,9 @@ dragonblocks.SpawnedEntity = class
                let entityDef = this.toEntity();
                entityDef.ondespawn && entityDef.ondespawn(this);
 
-               let id = this.id;
+               let self = this;
                this.map.entities = this.map.entities.filter(entity => {
-                       return entity.id != id;
+                       return entity != self;
                });
 
                clearInterval(this.physicInterval);