Skip to content

Commit

Permalink
fix: 馃悰 fix for velocity being 0 instead of null or an object
Browse files Browse the repository at this point in the history
temporary fix for #834
  • Loading branch information
thkruz committed Dec 20, 2023
1 parent 1c60fee commit 30ccd82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/singletons/dots-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30ccd82

Please sign in to comment.