Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stop creation of ladder waypoints in air while autowaypoint=1 and a player uses grapple hook in OP4
Bug
The PlayerClient_Valve_CurrentWeapon function sometimes didn't correctly keep track of a player's weapon when
autowaypoint=1
and this led to creation of ladder waypoints in midair while a player used the grapple hookFix
What the OP4 engine itself uses for ladder detection is the otherwise unused FL_IMMUNE_LAVA (0x80000) (1<<19) flag.
CGrapple.cpp#L168
pm_shared.cpp#L617
The

halflife-op4-updated
repo is a remake of the original OP4 dll so I did check with a decompiler that this functionality does indeed exist in the vanilla game (opfor.dll / opfor.so) and wasn't something that was added for the updated versionArtifact
Archive: jk_botti_grapple_bug.zip
Contains files: op4_bounce.bsp (the map where the bug occured) and op4_bounce.wpt + op4_bounce.matrix the bugged waypoint files
Note: You need to replace
MSG_ALL:MSG_ONE
withMSG_BROADCAST:MSG_ONE_UNRELIABLE
in waypoint.cpp if you wish to view these ingame withshow_waypoints 1
as there are so many waypoints in the file that the reliable channel will otherwise overflow.