fix: 修复血精石满充能后重置问题#151
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 595acb2472
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if currUses < maxUses then | ||
| finiteuses:SetUses(math.min(maxUses, currUses + factor)) |
There was a problem hiding this comment.
Clamp overcharged bloodstones back to max uses
When a bloodstone already has GetUses() >= total (e.g., save data created before this fix), this branch does nothing and leaves the invalid overcharged value in place. That is a regression from the previous logic, which always forced over-100% charge back to max via SetPercent(1), and it can let players keep unintended extra healing until the stone is consumed. Add a clamp path for currUses >= maxUses so existing abnormal stones are normalized.
Useful? React with 👍 / 👎.
血精石充能逻辑修复,旧神因子在白天结算时对血精石的充能改为读取当前次数并按上限截断后写回,避免已满状态继续叠加导致次数异常从而出现“满充能后重置”的问题;同时保留原有的溢出处理路径,确保将多余因子稳定转化到背包中的血精石,不会再因满值边界触发造成充能表现反复。
Codex Task