From 2d9de004247f9230d797336992f6636734e38b91 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 2 May 2022 08:53:58 -0500 Subject: [PATCH] Make nested player proxies of arrays as well as objects --- src/game/player.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/player.ts b/src/game/player.ts index 7431c84..f181b49 100644 --- a/src/game/player.ts +++ b/src/game/player.ts @@ -51,7 +51,11 @@ const playerHandler: ProxyHandler> = { } const value = target[ProxyState][key]; - if (key !== "value" && isPlainObject(value) && !(value instanceof Decimal)) { + if ( + key !== "value" && + (isPlainObject(value) || Array.isArray(value)) && + !(value instanceof Decimal) + ) { if (value !== target[key]?.[ProxyState]) { const path = [...target[ProxyPath], key]; target[key] = new Proxy({ [ProxyState]: value, [ProxyPath]: path }, playerHandler);