Skip to content

Fix Arcane Cloak using negative unreserved mana (#5411) - #10517

Merged
Wires77 merged 1 commit into
PathOfBuildingCommunity:devfrom
eduardomdalmaso:fix/arcane-cloak-negative-unreserved-mana
Nov 24, 2026
Merged

Wires77 merged 1 commit into
PathOfBuildingCommunity:devfrom
eduardomdalmaso:fix/arcane-cloak-negative-unreserved-mana

Conversation

@eduardomdalmaso

Copy link
Copy Markdown
Contributor

Fixes #5411.

Description of the problem being solved:

When more than 100% of mana is reserved (ManaUnreserved < 0), ModStoreClass:GetStat("ManaUnreserved") in src/Classes/ModStore.lua was reverse-engineering a positive mana value larger than maximum mana instead of returning 0. This caused skills that scale with ManaUnreserved (such as Arcane Cloak) to grant added lightning damage, guard absorb, and mana spent recently even though 0 unreserved mana is available.

Steps taken to verify a working solution:

  • Reproduced the issue in headless mode (Arc 20/0 + Determination, Pride, Malevolence resulting in Mana: 50, ManaUnreserved: -25, where enabling Arcane Cloak erroneously increased TotalDPS from 1788.44 to 1804.30).
  • Updated ModStoreClass:GetStat in src/Classes/ModStore.lua to return 0 when ManaUnreserved < 0.
  • Added a unit test in spec/System/TestDefence_spec.lua and ran the full test suite via busted --lua=luajit (746 successes / 0 failures / 0 errors / 0 pending).

Link to a build that showcases this PR:

https://poe.ninja/pob/Mi1 (from #5411)

Before screenshot:

N/A (verified via headless busted --lua=luajit)

After screenshot:

N/A (verified via headless busted --lua=luajit)

@Wires77 Wires77 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apparently this interaction has been broken since #4514

Changing it to just return 0 seems odd to me, but it also seems correct

@Wires77
Wires77 merged commit afe5ada into PathOfBuildingCommunity:dev Nov 24, 2026
3 checks passed
@Wires77 Wires77 added the bug: calculation Numerical differences label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: calculation Numerical differences

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arcane cloak breaks a lot of calculations if used with negative unreserved mana

2 participants