Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several problems related to sliding down slopes #41

Merged
merged 5 commits into from
Apr 1, 2016
Merged

Fix several problems related to sliding down slopes #41

merged 5 commits into from
Apr 1, 2016

Conversation

TomyLobo
Copy link
Collaborator

Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime

m_flSlideStartTime is the time the player started sliding.
m_flSlideAutoEndTime is the time the slide will end on its own, if the player doesn't interrupt it earlier.

When sliding down slopes, now only m_flSlideAutoEndTime is incremented and m_flSlideStartTime stays at the initial value.
This allowed fixing several problems related to sliding down slopes:

  • Sliding down slopes can now be interrupted properly
  • Eye offset is now properly adjusted when starting a slide on a slope
  • The reslide timer is properly reset after sliding down a long slope

Workaround for the first problem: da_slide_unclick_time -1000
This disables slide lock completely, so a proper solution is preferable.

@@ -799,7 +799,7 @@ void CDAPlayerShared::StartSliding(bool bDiveSliding)
void CDAPlayerShared::EndSlide()
{
// If it was long enough to notice what it was, then train the slide.
if (gpGlobals->curtime > m_flSlideTime + 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but FYI: the way I usually think of this is, m_flSlideTime + 1 is when the timer expires, so we're waiting for curtime to pass that. The other one is legit pretty confusing though.

@BSVino
Copy link
Owner

BSVino commented Mar 31, 2016

Be aware that the slide never automatically stopping when sliding down slopes was an intentional feature. I can't tell whether that's what you were trying to change. Other than that, it looks good. Ship it.

@TomyLobo
Copy link
Collaborator Author

TomyLobo commented Mar 31, 2016

You can still slide down slopes as if they weren't there.
But I made it so da_slide_unclick_time, the eye offset adjustment code and the reslide timer are independent of whether you started your slide on a slope or not.
The slide duration is still constantly increased while going down a slope.

…isons of delta times

This should make it more easily understandable.
Numerical conditioning is probably better as well... Not that it matters :)
m_flSlideStartTime is the time the player started sliding.
m_flSlideAutoEndTime is the time the slide will end on its own, if the player doesn't interrupt it earlier.

When sliding down slopes, now only m_flSlideAutoEndTime is incremented and m_flSlideStartTime stays at the initial value.
This allowed fixing several problems related to sliding down slopes:
- Sliding down slopes can now be interrupted properly
- Eye offset is now properly adjusted when starting a slide on a slope
- The reslide timer is properly reset after sliding down a long slope
@TomyLobo
Copy link
Collaborator Author

TomyLobo commented Apr 1, 2016

Concerns about removing the slope slide feature addressed.
No unaddressed concerns => merging

@TomyLobo TomyLobo merged commit 54fb178 into BSVino:develop Apr 1, 2016
@TomyLobo TomyLobo deleted the fix-slope-slide branch April 1, 2016 17:59
@TomyLobo TomyLobo added this to the v1.2.1 milestone Apr 3, 2016
@TomyLobo TomyLobo changed the title Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime Fix several problems related to sliding down slopes Apr 3, 2016
TomyLobo added a commit that referenced this pull request Apr 20, 2016
Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime
shmopaloppa pushed a commit to shmopaloppa/DoubleAction that referenced this pull request Sep 13, 2017
Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants