Skip to content

Commit 30ccd82

Browse files
committed
fix: 🐛 fix for velocity being 0 instead of null or an object
temporary fix for #834
1 parent 1c60fee commit 30ccd82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/singletons/dots-manager.ts

+7
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,13 @@ export class DotsManager {
505505

506506
sat.velocity ??= { total: 0, x: 0, y: 0, z: 0 };
507507

508+
// Fix for https://github.com/thkruz/keeptrack.space/issues/834
509+
// TODO: Remove this once we figure out why this is happening
510+
// @ts-ignore
511+
if (sat.velocity === 0) {
512+
sat.velocity = { total: 0, x: 0, y: 0, z: 0 };
513+
}
514+
508515
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];
509516
sat.velocity.x = this.velocityData[i * 3] || 0;
510517
sat.velocity.y = this.velocityData[i * 3 + 1] || 0;

0 commit comments

Comments
 (0)