Browse Source

Rename destroyedBy & send visibility destroy event

tags/v0.11.0
kckckc 2 years ago
parent
commit
677522eb81
2 changed files with 10 additions and 4 deletions
  1. +1
    -1
      src/server/components/stats.js
  2. +9
    -3
      src/server/world/syncer.js

+ 1
- 1
src/server/components/stats.js View File

@@ -438,7 +438,7 @@ module.exports = {
this.obj.spellbook.die(); this.obj.spellbook.die();


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


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


+ 9
- 3
src/server/world/syncer.js View File

@@ -70,7 +70,7 @@ module.exports = {
sync = { sync = {
id: o.id, id: o.id,
destroyed: true, destroyed: true,
destroyedBy: o.destroyedBy
destructionEvent: o.destructionEvent
}; };


objects.removeObject(o); objects.removeObject(o);
@@ -113,8 +113,14 @@ module.exports = {
} }


if (destroyed || !canSee) { 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); p.player.unsee(oId);
} }


Loading…
Cancel
Save