diff --git a/src/server/components/stats.js b/src/server/components/stats.js index 1b094f5f..c5d589c7 100644 --- a/src/server/components/stats.js +++ b/src/server/components/stats.js @@ -436,7 +436,9 @@ module.exports = { obj.effects.die(); if (this.obj.spellbook) this.obj.spellbook.die(); + obj.destroyed = true; + obj.destructionEvent = 'death'; let deathAnimation = _.getDeepProperty(animations, ['mobs', obj.sheetName, obj.cell, 'death']); if (deathAnimation) { diff --git a/src/server/world/syncer.js b/src/server/world/syncer.js index ea582a3b..79ab5777 100644 --- a/src/server/world/syncer.js +++ b/src/server/world/syncer.js @@ -59,7 +59,7 @@ module.exports = { continue; let destroyed = o.destroyed; - + let sync = null; let syncSelf = null; if (!destroyed) { @@ -69,7 +69,8 @@ module.exports = { } else { sync = { id: o.id, - destroyed: true + destroyed: true, + destructionEvent: o.destructionEvent }; objects.removeObject(o); @@ -112,8 +113,14 @@ module.exports = { } if (destroyed || !canSee) { - if (!canSee) - queueFunction({ id: oId, destroyed: true }, [ p.serverId ]); + if (!canSee) { + queueFunction({ + id: oId, + destroyed: true, + destructionEvent: 'visibility' + }, + [ p.serverId ]); + } p.player.unsee(oId); }