Skip to content

Conversation

CuddlyBunion341
Copy link
Owner

@CuddlyBunion341 CuddlyBunion341 commented Oct 19, 2024

When running the application in debug mode, the terrain generation system would crash because of invalid casting from negative i32 to usize. This issue is not noticable in release mode because such checks are not included because of performance reasons.

To fix this problem, more care should be taken for the conversion of block coordinates. Also usize should be used instead of i32 where applicable.

Maybe this change is stupid.

Manual tests

  • Client doesn't immediately crash
  • Chunks get created successfully
  • Chunk meshing doesn't create artifacts
  • Blocks can be placed properly
  • Blocks can be destroyed properly

@CuddlyBunion341 CuddlyBunion341 self-assigned this Oct 19, 2024
@CuddlyBunion341 CuddlyBunion341 marked this pull request as draft October 20, 2024 08:31
@CuddlyBunion341 CuddlyBunion341 marked this pull request as ready for review October 20, 2024 09:10
@CuddlyBunion341 CuddlyBunion341 merged commit e2a2d89 into main Oct 20, 2024
3 checks passed
@CuddlyBunion341 CuddlyBunion341 deleted the feature/fix-integer-overflow branch October 20, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant