Skip to content

Commit

Permalink
Fixed crash when the voids mesh is shifted
Browse files Browse the repository at this point in the history
  • Loading branch information
Naviary2 committed Jan 20, 2025
1 parent 731c033 commit 764c225
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client/scripts/esm/chess/logic/gamefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ function gamefile(metadata, { moves = [], variantOptions, gameConclusion, clockV

/** The object that contains the buffer model to render the voids */
this.voidMesh = {
/** High precision Float64Array for performing arithmetic. */
/** High precision Float64Array for performing arithmetic. @type {Float64Array} */
data64: undefined,
/** Low precision Float32Array for passing into gpu. */
/** Low precision Float32Array for passing into gpu. @type {Float32Array} */
data32: undefined,
/** The buffer model of the void squares. These are rendered separately
* from the pieces because we can simplify the mesh greatly.
Expand Down
2 changes: 1 addition & 1 deletion src/client/scripts/esm/game/rendering/voids.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function shiftModel(gamefile, diffXOffset, diffYOffset) {
data32[i + 1] = data64[i + 1];
}

gamefile.voidMesh.model.updateBuffer(); // Reinit the model because its data has been updated
gamefile.voidMesh.model.updateBufferIndices(0, data64.length); // Reinit the model because its data has been updated
}

/**
Expand Down

0 comments on commit 764c225

Please sign in to comment.