Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Stop bouncing when prone
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Dec 27, 2023
1 parent 04829b5 commit 7bfdfb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Entities/AtomGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,9 +1267,13 @@ namespace RTE {
owner->GetController()->IsState(MOVE_RIGHT) && pushImpulse.m_X < 0.0F;
if (againstTravelDirection) {
// Filter some of our impulse out. We're pushing against an obstacle, but we don't want to kick backwards!
// Translate it into to upwards motion to step over what we're walking into instead ;)
const float againstIntendedDirectionMultiplier = 0.5F;
pushImpulse.m_Y -= std::abs(pushImpulse.m_X * (1.0F - againstIntendedDirectionMultiplier));

if (!owner->GetController()->IsState(BODY_CROUCH) && !owner->GetController()->IsState(MOVE_DOWN)) {
// Translate it into to upwards motion to step over what we're walking into instead ;)
pushImpulse.m_Y -= std::abs(pushImpulse.m_X * (1.0F - againstIntendedDirectionMultiplier));
}

pushImpulse.m_X *= againstIntendedDirectionMultiplier;
}
}
Expand Down

0 comments on commit 7bfdfb4

Please sign in to comment.