Repository navigation
fix(skills): let skills with the same effect share one magic effect - #1614
Conversation
CreateEffect compared the chance of an existing effect with Equals, but an effect without a chance has no Chance value at all, so the comparison never matched and every poison and ice skill got its own identical Poisoned or Iced effect. A missing chance now counts as 0, so new databases get one effect per distinct setting. Fixes MUnique#1526 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 6 |
| Duplication | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
sven-n
left a comment
There was a problem hiding this comment.
LGTM. Comparing the chance as (e.Chance?.ConstantValue.Value ?? 0) == chance fixes the null-vs-0 mismatch, so skills with the same poison or ice setting share one effect in new databases (instead of 14 Iced and 7 Poisoned copies). Existing databases keep their identical duplicates, which is harmless.
I built it on current master and ran the tests, including Persistence.Initialization.Tests (1011 passed): everything passes.
Generated by Claude Code
Fixes #1526 (the part for new databases)
What
The skills with the same poison or ice effect setting share one magic effect, instead of each one getting its own identical Poisoned or Iced effect.
Why
CreateEffectlooks for an existing effect and compares the chance withEquals(e.Chance?.ConstantValue.Value, chance). An effect without a chance has noChancevalue, sonullwas compared with0and never matched. A Season 6 database got 14 Iced and 7 Poisoned effects.Changes
SkillsInitializerBase.CreateEffectand the same method ofAddMovementSpeedAttributesPlugInBasecount a missing chance as 0.Existing databases keep their copies. Merging them needs an update plug-in which must leave customized copies alone, so it's left for a follow-up.
Tests
SkillEffectsDataTest.SkillsShareIdenticalEffectsAsync: no two Poisoned, Iced, Cold or Freeze effects of a new Season 6 database have the same number, element, duration, chance and target. It fails without the fix (13 and 6 duplicates).tests/MUnique.OpenMU.Persistence.Initialization.Testspass (870 passed, 12 skipped).