Fix Npc being stuck after using skill - #543
Conversation
Npc used skill and immediately tried to go back to spawn before skill keyframe ended
WalkthroughThis update introduces code modernizations, logging adjustments, and refinements to NPC idle behavior. It replaces field checks with property pattern matching, exposes a task property, broadens idle animation detection, and prevents idle movement during active casting. Several unused imports are removed, and logging verbosity is reduced for specific opcodes and cinematic UI actions. Changes
Sequence Diagram(s)sequenceDiagram
participant FieldNpc
participant MovementState
FieldNpc->>MovementState: Check CastTask
alt CastTask is null
FieldNpc->>MovementState: Start idle move to patrol/origin
else CastTask active
FieldNpc-->>FieldNpc: Skip idle movement
end
FieldNpc->>FieldNpc: Animate(sequence)
alt sequence contains "idle" or "sit"
FieldNpc->>FieldNpc: Set idle task
end
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (9)
💤 Files with no reviewable changes (2)
🧰 Additional context used🧬 Code Graph Analysis (1)Maple2.Server.Game/Model/Field/Actor/ActorStateComponent/BattleState.cs (2)
🔇 Additional comments (12)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Npc used skill and immediately tried to go back to spawn before skill keyframe ended
Summary by CodeRabbit
New Features
Refactor
Style
Chores