Skip to content

fix misplaced parens in HpRegenPerTick/MpRegenPerTick formulas#3

Merged
baughj merged 1 commit into
mainfrom
fix-serverconfig-formula-parens
Apr 26, 2026
Merged

fix misplaced parens in HpRegenPerTick/MpRegenPerTick formulas#3
baughj merged 1 commit into
mainfrom
fix-serverconfig-formula-parens

Conversation

@Caeldeth
Copy link
Copy Markdown
Contributor

@Caeldeth Caeldeth commented Apr 26, 2026

Summary

  • Min(...) in both regen formulas was receiving a single argument because the closing paren landed at the end of the expression instead of after the inner multiplication
  • The cap term (SOURCEMAXIMUMHP/MP * 0.20) was being swallowed into the first arg, so Min() effectively did nothing — there was no upper bound on regen
  • Two-line edit in src/XSD/ServerConfig.xsd (lines 249-250)

Before

Min(SOURCEMAXIMUMMP * (0.1 + Max(SOURCEWIS, SOURCEWIS - SOURCELEVEL) * 0.01, SOURCEMAXIMUMMP * 0.20))

One arg to Min. The , lives inside the inner (...) — gibberish.

After

Min(SOURCEMAXIMUMMP * (0.1 + Max(SOURCEWIS, SOURCEWIS - SOURCELEVEL) * 0.01), SOURCEMAXIMUMMP * 0.20)

Two args: the regen value, capped at 20% of max.

Test plan

  • Sanity check the formula parses in the server's expression evaluator
  • Confirm regen behavior matches the cap (regen never exceeds 20% of max HP/MP per tick)

🤖 Generated with Claude Code

Min(...) was receiving a single argument because the closing paren
landed at the end of the expression instead of after the inner
multiplication. The cap term (maxHP/MP * 0.20) was being swallowed
into the first arg, so Min() effectively did nothing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Copy Markdown
Member

@baughj baughj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved fullwise

@baughj baughj merged commit 94124b0 into main Apr 26, 2026
3 checks passed
@Caeldeth Caeldeth deleted the fix-serverconfig-formula-parens branch April 27, 2026 23: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