diff --git a/lib/server/controllers/entitycontroller.js b/lib/server/controllers/entitycontroller.js index 6ac0eb1..95b0910 100644 --- a/lib/server/controllers/entitycontroller.js +++ b/lib/server/controllers/entitycontroller.js @@ -25,6 +25,11 @@ EntityController.prototype = { return newEntity; }, remove: function (id) { - + for (var i = 0; i < this.entities.length; i ++) { + if (this.entities[i].id === id) { + this.entities.splice(i, 1)[0]; + return; + } + } } }; \ No newline at end of file diff --git a/lib/server/controllers/playercontroller.js b/lib/server/controllers/playercontroller.js index ec563cc..1591ab1 100644 --- a/lib/server/controllers/playercontroller.js +++ b/lib/server/controllers/playercontroller.js @@ -27,15 +27,6 @@ PlayerController.prototype.add = function (client) { return newPlayer; }; -PlayerController.prototype.remove = function (id) { - for (var i = 0; i < this.entities.length; i ++) { - if (this.entities[i].client.id === id) { - this.entities.splice(i, 1)[0]; - return; - } - } -}; - PlayerController.prototype.addInput = function (id, input, sequence, time) { this.entities.some(function (player) { if (player.client.id === id) {