Fix check before calculating entity pushback, was causing a NaN and probably other bugs

This commit is contained in:
Imbris 2021-07-19 01:31:11 -04:00
parent fc9777179f
commit ceb800f187

View File

@ -439,8 +439,8 @@ impl<'a> PhysicsData<'a> {
// Don't apply force when entity is a sticky which is on the
// ground (or on the wall)
if !forced_movement
&& !is_sticky
|| is_mid_air
&& (!is_sticky
|| is_mid_air)
&& diff.magnitude_squared() > 0.0
&& !is_projectile
&& !matches!(collider_other,Some(Collider::Voxel { .. }))