From 86a3367efaa124453f86e85b36ec085d2ebc31ee Mon Sep 17 00:00:00 2001 From: cha0s Date: Tue, 2 Jul 2024 21:25:52 -0500 Subject: [PATCH] fix: avoid work --- app/ecs-systems/water.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ecs-systems/water.js b/app/ecs-systems/water.js index b360bd4..e8ba594 100644 --- a/app/ecs-systems/water.js +++ b/app/ecs-systems/water.js @@ -9,7 +9,9 @@ export default class Water extends System { for (const tile in Water.water) { Water.water[tile] = Math.max(0, Water.water[tile] - elapsed); } - Water.water = {...Water.water}; + if (Object.keys(Water.water).length > 0) { + Water.water = {...Water.water}; + } } }