Skip to content

fix: a hero who dies in water no longer swims - the corpse, the view and the death menu stay still, 'New game' and 'Load' can be hit - #586

Open
BoroBongo wants to merge 2 commits into
developfrom
fix/dead-hero-stops-swimming
Open

BoroBongo wants to merge 2 commits into
developfrom
fix/dead-hero-stops-swimming

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

A hero who dies in water no longer swims. Before, the corpse kept bobbing and the player's hands kept stroking: the grip plus a hand moving towards the death menu pushed the rig, so the menu swayed and "New game" / "Load" were hard to hit.

On HeroDied, VRSwimDive stops everything at once:

  • the swim and dive strokes;
  • the water bobbing (the coroutine that moved the corpse up and down);
  • the dive (StopDiving, and the dark fade ends).

The mode stays as it was. Loading a game (LoadGameStart) starts over: the old world's hero isn't read while the new world loads, and WorldSceneLoaded leaves the water if the hero spawns on land.

Why

Playtest (G1 Mroczne Tajemnice, a Gothic 1 mod, VR simulator): after dying while swimming the death menu kept swaying with the floating corpse and couldn't be clicked.

How to test manually

  • Swim in deep water (G1: the river below the Old Camp's cliffs) and die (Marvin kill on yourself, or a monster). The log shows [VRSwimDive] The hero died (Swim) - swimming stops until a game is loaded., the corpse and the view stay still, and "New game" / "Load" in the death menu can be hit.
  • Die while diving: the dark dive fade ends.
  • From the death menu load a save on land: you walk normally. Load a save in water: you swim again.
  • Main menu without a game: no "hero died" log line.

Save/load

Nothing is saved. A load clears the stop and the old hero references.

Known gaps / follow-ups

  • Reviews: .claude/review/fix-dead-hero-stops-swimming/ (architecture: fits with concerns -> bobbing and event-driven stop fixed; gothic: no bugs, three nits fixed). Kept for later on purpose: one shared "hero movement frozen" answer for all movement adapters, because death is the only reason today (YAGNI).

🤖 Generated with Claude Code

BoroBongo and others added 2 commits November 30, 2026 00:17
…ath menu stay still, "New game" and "Load" can be hit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stops it all at once, a loaded game starts over without reading the old world's hero

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BoroBongo

Copy link
Copy Markdown
Contributor Author

AI review (architecture-reviewer + gothic-reviewer)

Commit Architecture Gothic
6949cf7 fits with concerns (1 major, 2 minor) no bugs, 1 caveat + 2 nits
787f698 all fixed except one deferred on purpose (below) all fixed

Fixed in this PR:

  • The water bobbing coroutine moved the corpse even after the first fix. Now HeroDied stops everything at once: the strokes, the bobbing, and the dive with its dark fade.
  • The stop is event-driven (HeroDied / LoadGameStart, with RemoveListener, like VrHeroDownPose). It no longer polls IsHeroAlive, and the main menu no longer logs a "dead hero".
  • While a game loads, the old world's hero isn't read. LoadGameStart clears the references and WorldSceneLoaded sets them again.

Deferred on purpose (YAGNI): one shared "hero movement frozen" answer for all movement adapters. Death is the only reason today that leaves the hero in water with input; a knocked-out or sleeping hero is already locked by the player locks.

Verified locally:

  • Compiles, 167/167 EditMode tests.
  • Editor test (G1 Mroczne Tajemnice, a Gothic 1 mod): a cheat kill while swimming stops the bobbing at once, and the rig stays at the same height for several seconds.
  • The author confirmed it in play.

Reports and answers: .claude/review/fix-dead-hero-stops-swimming/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant