Repository navigation
Keep the player's mob animation when Wld_SetTime resets npcs - #1086
Open
pieterdeschepper wants to merge 1 commit into
Open
pieterdeschepper wants to merge 1 commit into
pieterdeschepper wants to merge 1 commit into
Conversation
Sleeping runs Wld_SetTime from the bed's dialog, which calls resetPositionToTA for all npcs. The player keeps its interaction, but its animations were stopped, so it stood up while still using the bed and only lay down again when the dialog closed and the mob played its exit transition. Don't stop the player's animation while it is using a mob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes item 8 of #944 (sleeping animation):
Cause
Choosing a sleep option calls
Wld_SetTimewhile the player is still lying in the bed.World::setDayTime→WorldObjects::resetPositionToTA→Npc::resetPositionToTAruns for every npc. For the player it already keeps the interaction (setInteraction(nullptr)is skipped for the player, andInteractive::resetPositionToTAskips mobs the player uses). But it still calledvisual.stopAnim(*this,""), which dropped the lying animation. When the dialog closes, the bed's exit transition plays from its lying state and the hero gets up again.Change
Npc::resetPositionToTAdoesn't stop the animations whilecurrentInteract!=nullptr. That can only be the player here, since other npcs have just had their interaction cleared. Everything else (clearAiQueue,clearState) is unchanged.Testing
Built on macOS (Apple M3 Pro) in a local build.
🤖 Generated with Claude Code