Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
RainrotElementFix
Harmony patch for RainrotSUL ElementCounter.ResetPowers. Stops the 'Collection was modified' crash when a skill override triggers a power recalculation.
By FFTeam
| Last updated | 17 hours ago |
| Total downloads | 10 |
| Total rating | 0 |
| Categories | Mods Libraries Server-side AI Generated |
| Dependency string | FFTeam-RainrotElementFix-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
RiskOfBrainrot-RainrotSUL
Shared Utility Library for the RiskOfBrainrot family of mods - including ArtificerExtended, 2R4R, SwanSongExtended, and more.
Preferred version: 1.7.5README
RainrotElementFix
Small BepInEx plugin. It patches RainrotSharedUtils.Components.ElementCounter.ResetPowers.
Why
ResetPowers loops over powerMap and writes to the same map. Unity's Mono runtime
treats a write to an existing key as a change. The loop then throws:
InvalidOperationException: Collection was modified; enumeration operation may not execute.
ArtificerExtended triggers this from PolarVortex.OnEnter via SetSkillOverride.
What it does
A Harmony Prefix takes over ResetPowers. It copies the keys first, then writes.
The original broken loop never runs.
Build
dotnet build -c Release
Install
Put RainrotElementFix.dll and manifest.json in:
BepInEx/plugins/RainrotElementFix/
Use the official RainrotSUL DLL. Do not use a rebuilt RainrotSUL with this patch.