From 30ccd8287f0d493f8678645d24464b44cba98dc7 Mon Sep 17 00:00:00 2001 From: Theodore Kruczek Date: Wed, 20 Dec 2023 08:14:13 -0500 Subject: [PATCH] fix: :bug: fix for velocity being 0 instead of null or an object temporary fix for #834 --- src/singletons/dots-manager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/singletons/dots-manager.ts b/src/singletons/dots-manager.ts index 1d1e142f..747b2520 100644 --- a/src/singletons/dots-manager.ts +++ b/src/singletons/dots-manager.ts @@ -505,6 +505,13 @@ export class DotsManager { sat.velocity ??= { total: 0, x: 0, y: 0, z: 0 }; + // Fix for https://github.com/thkruz/keeptrack.space/issues/834 + // TODO: Remove this once we figure out why this is happening + // @ts-ignore + if (sat.velocity === 0) { + sat.velocity = { total: 0, x: 0, y: 0, z: 0 }; + } + const isChanged = sat.velocity.x !== this.velocityData[i * 3] || sat.velocity.y !== this.velocityData[i * 3 + 1] || sat.velocity.z !== this.velocityData[i * 3 + 2]; sat.velocity.x = this.velocityData[i * 3] || 0; sat.velocity.y = this.velocityData[i * 3 + 1] || 0;