Skip to content

Keep the player's mob animation when Wld_SetTime resets npcs - #1086

Open
pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:keep-player-mob-anim-on-settime
Open

pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:keep-player-mob-anim-on-settime

Conversation

@pieterdeschepper

@pieterdeschepper pieterdeschepper commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes item 8 of #944 (sleeping animation):

After sleeping, the character briefly snaps into a standing position instead of remaining in bed. Only after exiting the sleep menu does the character return to the lying animation and then get up normally.

Cause

Choosing a sleep option calls Wld_SetTime while the player is still lying in the bed. World::setDayTime → WorldObjects::resetPositionToTA → Npc::resetPositionToTA runs for every npc. For the player it already keeps the interaction (setInteraction(nullptr) is skipped for the player, and Interactive::resetPositionToTA skips mobs the player uses). But it still called visual.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::resetPositionToTA doesn't stop the animations while currentInteract!=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

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>
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