Rule-updated entities should get new burnable/sinkable
This commit is contained in:
parent
3b6282c152
commit
3f6a14e142
@ -90,8 +90,11 @@ game.system.Logic = (entitiesGrid) => {
|
|||||||
const entity = entities[id];
|
const entity = entities[id];
|
||||||
if (entity.hasComponent("name") && entity.components.name.selector == entityName) {
|
if (entity.hasComponent("name") && entity.components.name.selector == entityName) {
|
||||||
const e = nounsToEntityCreators[applicationEntityName]();
|
const e = nounsToEntityCreators[applicationEntityName]();
|
||||||
entity.components.name = e.components.name;
|
["name", "sprite", "burnable", "sinkable"].map((name) => {
|
||||||
entity.components.sprite = e.components.sprite;
|
if (e.hasComponent(name)) {
|
||||||
|
entity.components[name] = e.components[name];
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user