Browse Source

Indicate if objects were destroyed by death or by visibility

tags/v0.11.0
kckckc 2 years ago
parent
commit
a338a5129e
2 changed files with 6 additions and 2 deletions
  1. +2
    -0
      src/server/components/stats.js
  2. +4
    -2
      src/server/world/syncer.js

+ 2
- 0
src/server/components/stats.js View File

@@ -436,7 +436,9 @@ module.exports = {
obj.effects.die();
if (this.obj.spellbook)
this.obj.spellbook.die();

obj.destroyed = true;
obj.destroyedBy = 'death';

let deathAnimation = _.getDeepProperty(animations, ['mobs', obj.sheetName, obj.cell, 'death']);
if (deathAnimation) {


+ 4
- 2
src/server/world/syncer.js View File

@@ -59,7 +59,8 @@ module.exports = {
continue;

let destroyed = o.destroyed;
let destroyedBy = o.destroyedBy;

let sync = null;
let syncSelf = null;
if (!destroyed) {
@@ -69,7 +70,8 @@ module.exports = {
} else {
sync = {
id: o.id,
destroyed: true
destroyed: true,
destroyedBy
};

objects.removeObject(o);


Loading…
Cancel
Save