ServersideQoL DuplicateSummonFix
Unofficial server-only fix preventing duplicate summon animation keys, such as Wizardry's staff_summon, from aborting ServersideQoL initialization.ServersideQoL Duplicate Summon Fix
Author: laredson
Unofficial, server-only compatibility patch for ServersideQoL 1.8.0.
It prevents PlayerSpawnedProcessor.Initialize from aborting when multiple modded summon staves use the same attack-animation key, for example:
System.ArgumentException: An item with the same key has already been added.
Key: staff_summon
This is known to occur with content packs that add multiple summon staves, including Wizardry.
What the patch changes
ServersideQoL inserts each summon animation into a dictionary with Dictionary.Add. A repeated animation key throws an exception. This patch changes only that insertion path:
- Unique key: behavior remains unchanged.
- Duplicate key: the configured duplicate policy is applied.
- Default
Merge: merges tracked summon-prefab lists and uses the highestMaxSpawnedvalue. KeepFirstandKeepLast: diagnostic fallback policies.
Because ServersideQoL indexes this data by animation rather than by individual staff, duplicate staves using the same animation share a combined summon cap under the default merge policy.
Installation
Install only on the dedicated server:
Valheim dedicated server/BepInEx/plugins/ServersideQoL.DuplicateSummonFix.dll
Clients do not need this patch.
Remove any earlier test build before installing this release.
Requires:
- BepInExPack Valheim 5.4.2333 or compatible
- ServersideQoL 1.8.0
Verification
At startup, the server log should contain:
[Info : ServersideQoL Duplicate Summon Fix] Patched PlayerSpawnedProcessor summon animation dictionary insertion.
When a duplicate is encountered, it logs the key once instead of throwing.
Configuration
Generated at:
BepInEx/config/laredson.serversideqol.duplicatesummonfix.cfg
Options:
DuplicatePolicy = Merge— recommended.LogDuplicateKeys = true— logs each duplicate key once.
Tested with
- Valheim 0.221.12
- ServersideQoL 1.8.0
- Wizardry 1.1.8
Compatibility scope
Built specifically for ServersideQoL 1.8.0. If a future ServersideQoL version fixes the issue, remove this patch. If the target method changes, this patch logs an error and does not alter unrelated code.
This is an unofficial patch and is not affiliated with the ServersideQoL or Wizardry authors.
