From 3f6a14e142d551db503d8b1228fb2c7924164303 Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Tue, 19 Apr 2022 20:53:06 -0600 Subject: [PATCH] Rule-updated entities should get new burnable/sinkable --- src/systems/logic.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/systems/logic.js b/src/systems/logic.js index 70f2c79..a29313f 100644 --- a/src/systems/logic.js +++ b/src/systems/logic.js @@ -90,8 +90,11 @@ game.system.Logic = (entitiesGrid) => { const entity = entities[id]; if (entity.hasComponent("name") && entity.components.name.selector == entityName) { const e = nounsToEntityCreators[applicationEntityName](); - entity.components.name = e.components.name; - entity.components.sprite = e.components.sprite; + ["name", "sprite", "burnable", "sinkable"].map((name) => { + if (e.hasComponent(name)) { + entity.components[name] = e.components[name]; + } + }); } } }