From 64c1a5921d78bac326cc4e8b0758f265959afe4e Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 29 Nov 2015 20:35:58 +0100 Subject: [PATCH] entity should despawn even if animation=false --- src/lib/plugins/pvp.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/plugins/pvp.js b/src/lib/plugins/pvp.js index 5103e02..2e4dfeb 100644 --- a/src/lib/plugins/pvp.js +++ b/src/lib/plugins/pvp.js @@ -47,11 +47,12 @@ module.exports.entity=function(entity,serv) entity.sendVelocity(velocity.scaled(1/32), maxVelocity); - if(entity.health<=0 && animation) { - entity._writeOthers('entity_status', { - entityId: entity.id, - entityStatus: 3 - }); + if(entity.health<=0) { + if(animation) + entity._writeOthers('entity_status', { + entityId: entity.id, + entityStatus: 3 + }); if(entity.type!="player") { delete serv.entities[entity.id]; setTimeout(() => {