fix: do actually send a removal step for removed (not just obscured) entities

This commit is contained in:
cha0s 2019-04-19 14:38:46 -05:00
parent 7c253fa13f
commit f3bc4b8ecb

View File

@ -140,9 +140,14 @@ export class Informed extends decorate(Trait) {
const parts = removal.get('parts');
const layerId = parts[3];
const uuid = parts[5];
this._rememberedEntities[uuid] = state.getIn(
const remembered = state.getIn(
['room', 'layers', layerId, 'entityList', uuid]
);
// Actually destroyed?
if (!remembered) {
return;
}
this._rememberedEntities[uuid] = remembered;
// Add overrides.
const overrides = this.entityOverrides(
removal.get('path'),
@ -155,7 +160,12 @@ export class Informed extends decorate(Trait) {
});
// Remove all removes.
return steps.filter((step) => {
return !isRemove(step);
if (!isRemove(step)) {
return true;
}
const parts = step.get('parts');
const uuid = parts[5];
return !(uuid in this._rememberedEntities);
});
}