-
Notifications
You must be signed in to change notification settings - Fork 41
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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.
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. |
You can still slide down slopes as if they weren't there. |
…isons of delta times This should make it more easily understandable. Numerical conditioning is probably better as well... Not that it matters :)
…sons have been learned
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
Concerns about removing the slope slide feature addressed. |
Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime
Split up m_flSlideTime into m_flSlideStartTime and m_flSlideAutoEndTime
Split up
m_flSlideTime
intom_flSlideStartTime
andm_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 andm_flSlideStartTime
stays at the initial value.This allowed fixing several problems related to sliding down slopes:
Workaround for the first problem:
da_slide_unclick_time -1000
This disables slide lock completely, so a proper solution is preferable.