Skip to content

Fix move_and_slide referencing mutable reference of cloned normal#948

Merged
Jondolf merged 1 commit into
mainfrom
fix-mns-callback-normal
Mar 3, 2026
Merged

Fix move_and_slide referencing mutable reference of cloned normal#948
Jondolf merged 1 commit into
mainfrom
fix-mns-callback-normal

Conversation

@Jondolf

@Jondolf Jondolf commented Mar 3, 2026

Copy link
Copy Markdown
Member

Objective

move_and_slide calls on_hit with a mutable reference to a clone of the hit normal, and the normal that ends up being used is always the original one. This means that if the user modifies the normal, it does nothing!

Solution

Use the potentially mutated normal instead.

@Jondolf Jondolf added this to the 0.6 milestone Mar 3, 2026
@Jondolf Jondolf added C-Bug Something isn't working D-Trivial Nice and straightforward! A great choice to get started with Avian A-Character-Controller Relates to character controllers labels Mar 3, 2026
@Jondolf Jondolf enabled auto-merge (squash) March 3, 2026 20:23
@Jondolf Jondolf merged commit 04cc8f7 into main Mar 3, 2026
6 checks passed
@Jondolf Jondolf deleted the fix-mns-callback-normal branch March 4, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Character-Controller Relates to character controllers C-Bug Something isn't working D-Trivial Nice and straightforward! A great choice to get started with Avian

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant