fix: monopolizers reset on ECS change

This commit is contained in:
cha0s 2024-07-14 02:28:32 -05:00
parent 12ce0ccbd5
commit ad18da3b93

View File

@ -241,8 +241,9 @@ export default function Ui({disconnected}) {
});
}, [chatIsOpen, client, debug, devtoolsIsOpen, monopolizers, setDebug, setScale]);
usePacket('EcsChange', async () => {
setMainEntity(undefined);
setEcs(new ClientEcs({Components, Systems}));
setMainEntity(undefined);
setMonopolizers([]);
}, [Components, Systems, setEcs, setMainEntity]);
usePacket('Tick', async (payload, client) => {
if (0 === Object.keys(payload.ecs).length) {