Fix breaking grab without spending moves by trying to climb up or down #37499
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.
Summary
SUMMARY: Bugfixes "Fix breaking grab without spending moves by trying to climb up or down."
Purpose of change
Closes #37488 - Exploit: breaking out of the grab without spending moves.
Describe the solution
Prior to this change game checked for character's inability to move due to being grabbed, crushed, webbed etc for all cases - even if there's no way to climb up or down at this location at all. So I moved check for "climbability" almost to the very top of
vertical_move
function, before themove_effects
check.Describe alternatives you've considered
None.
Testing
Spawned a zombie, let it grab myself, tried to climb up and down. Got "You can't go up/down here" message, no checks for breaking grab were made.
Additional context
None.