From 0754a3804e3600cf8c154b5288c6f85cba37de22 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 11 Apr 2022 18:18:45 -0500 Subject: [PATCH] flow: room editing --- packages/topdown/src/persea/controllers/room/component.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/topdown/src/persea/controllers/room/component.jsx b/packages/topdown/src/persea/controllers/room/component.jsx index 531c5d5..2183fbe 100644 --- a/packages/topdown/src/persea/controllers/room/component.jsx +++ b/packages/topdown/src/persea/controllers/room/component.jsx @@ -69,9 +69,13 @@ const RoomComponent = ({ // Otherwise, we'll update the room. else { const updateRoom = async () => { + // Update entities. if (previousResource.entities !== resource.entities) { if (previousResource.entities.length !== resource.entities.length) { await room.entityList.load(resource.entities); + Object.values(room.entities()).forEach((entity) => { + entity.renderTick(Infinity); + }); } else { for (let i = 0; i < resource.entities.length; i++) { @@ -85,6 +89,7 @@ const RoomComponent = ({ } } } + // Update tiles. if (previousResource.tiles !== resource.tiles) { if (previousResource.tiles.length !== resource.tiles.length) { await room.loadTiles(resource.tiles);