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 the bug that prevents players from diving right after spawning the first time on da_official #32

Closed
wants to merge 3 commits into from
Closed

Fix the bug that prevents players from diving right after spawning the first time on da_official #32

wants to merge 3 commits into from

Conversation

TomyLobo
Copy link
Collaborator

This patch resets the "last known ground entity" field right after calling CBasePlayer::Spawn

This fixes the bug that prevents players from diving right after spawning the first time on da_official.
The bug also occurs after you switch from spectator to normal mode.

Explanation:
CBasePlayer::Spawn invoked ClearFlags, clearing, among others, FL_ONGROUND.
However, it did not invoke SetGroundEntity(NULL); in order to remove the world entity from the "last ground entity" field.
This, in turn, made subsequent calls to SetGroundEntity do nothing, since that function returns early if the "last ground entity" field is the same as its parameter.
So despite FullWalkMove happily calling SetGroundEntity($worldentity) all the time, FL_ONGROUND wasn't set.

This patch works, but I'm not sure if this is the correct place to but the SetGroundEntity(NULL); call.

BSVino and others added 3 commits March 25, 2016 15:53
(Includes the changes that were in a different commit before the cleanup - TomyLobo)
I fished this out of the drugs commit - TomyLobo
This fixes the bug that prevents players from diving right after spawning the first time on da_official.
The bug also occurs after you switch from spectator to normal mode.
@TomyLobo
Copy link
Collaborator Author

I need to close and remake this PR in order to retarget it at the develop branch.

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