Repository navigation
Conversation
An NPC wading in shallow water can start a climb from onMoveFailed when it walks into a ledge. Npc::tryJump only refuses climbing while sliding, swimming or diving, so wading is a valid start state, but assertStateChange did not list ClimbUp for InWater and aborted debug builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Debug builds abort with:
Reproduced with a Gothic I save: an orc clan warrior (log shows "Ork Klankrieger") fell into the water under the bridge to the orc city while following the player, player wearing Ulu-Mulu. The orc clan warrior stayed there in the water. The water is partially shallow, so orc is wading.
Because of full world simulation approach, even distant NPCs are never dropped from memory. So the orc keeps walking through the shallow water and runs into the ledge again and again.
Cause
Backtrace:
Wading orc move fails at a ledge,
onMoveFailedasksNpc::tryJump()for a climb and gets a low enough climb-up option, sostartClimbrequestsClimbUp.Npc::tryJump()only refuses climbing only while sliding, swimming or diving.InWater -> ClimbUpentry is missing.Implementation
Add
ClimbUpto the allowed transitions forInWaterinMoveAlgo::assertStateChange.Validation
Gothic2NotrandSpacer(debug) built on Linux.Gothic I Savegame attached:
save_slot_5.sav.tar.gz
This will work for NPCs, too. Will also work in Gothic II, so not Gothic I specific.