Skip to content

Fix direction knock back for region skills#637

Merged
AngeloTadeucci merged 1 commit intomasterfrom
fix/region-skill-knockback-direction
Feb 13, 2026
Merged

Fix direction knock back for region skills#637
AngeloTadeucci merged 1 commit intomasterfrom
fix/region-skill-knockback-direction

Conversation

@AngeloTadeucci
Copy link
Collaborator

@AngeloTadeucci AngeloTadeucci commented Feb 13, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved accuracy of damage source positioning and directional calculations for attacks, particularly for knockback and push effects.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

These changes refine the damage application and skill serialization pipeline by adjusting source position calculation with fallback logic, implementing proper direction handling for push effects, and standardizing object ID and position usage across the damage record initialization and packet serialization layers.

Changes

Cohort / File(s) Summary
Damage Application Logic
Maple2.Server.Game/Model/Field/Actor/Actor.cs, Maple2.Server.Game/Model/Field/Entity/FieldSkill.cs
Modified ApplyDamage to compute sourcePosition with near-zero fallback; updated targetRecord initialization with Position and Direction values. Updated FieldSkill DamageRecord construction to use ObjectId and include Position parameter.
Packet Serialization
Maple2.Server.Game/Packets/RegionSkillPacket.cs
Changed RegionSkillPacket.Add to serialize FieldSkill's ObjectId instead of Caster's ObjectId in the payload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Zintixx

Poem

🐰 A hop, a skip, through damage's way,
Where positions bloom and directions sway,
Push or pull with offset's grace,
Object IDs find their proper place!
The packets fly with corrected sight,
Now skill and caster align just right! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix direction knock back for region skills' directly relates to the main changeset, which improves direction handling for push-damage scenarios in region skills by computing correct source positions and push directions.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/region-skill-knockback-direction

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
Maple2.Server.Game/Model/Field/Actor/Actor.cs (1)

97-102: Position-at-origin as sentinel is fragile — consider a more explicit check.

Using caster.Position.LengthSquared() < 0.001f to detect "dummy" region-skill casters works only if no real caster can ever be near the world origin. If that assumption holds for this game, this is fine, but it's worth a comment or a more explicit mechanism (e.g., a flag or interface check) if this pattern spreads.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AngeloTadeucci AngeloTadeucci merged commit 1932dc7 into master Feb 13, 2026
4 checks passed
@AngeloTadeucci AngeloTadeucci deleted the fix/region-skill-knockback-direction branch February 14, 2026 04:16
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.

2 participants