InvalidOperationException: Collection was modifiedFixed
Failed to call hook 'ToggleCommand' on plugin 'BlueprintShare v2.0.0' (InvalidOperationException: Collection was modified; enumeration operation may not execute.)
  at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0                                                                                2kb/s in, 4kb/s out
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at Oxide.Plugins.BlueprintShare.ShareWithPlayer (BasePlayer player, BasePlayer target) [0x000e4] in <afbe389e14a34c878edd12c05915c873>:0
  at Oxide.Plugins.BlueprintShare.ToggleCommand (BasePlayer player, System.String command, System.String[] args) [0x00276] in <afbe389e14a34c878edd12c05915c873>:0
  at Oxide.Plugins.BlueprintShare.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x011d9] in <afbe389e14a34c878edd12c05915c873>:0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <e23ba2c0f246426296d81c842cbda3af>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <50629aa0e75d4126b345d8d9d64da28d>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <50629aa0e75d4126b345d8d9d64da28d>:0
                                             

Hi again, getting this error with the latest update when manually sharing. Honestly I've been tinkering a bit so it's possible it's just my version, but regardless, I've fixed it by changing the following in ShareWithPlayer:

foreach (var blueprint in playerBlueprints)

to

foreach (var blueprint in playerBlueprints.ToList())

Was this happening to the official version of the plugin before you modified it?

ccreep

Was this happening to the official version of the plugin before you modified it?

Honestly I'm not sure, and I should have tested that before I made this thread really. I'll test it today and let you know



Merged post

OK yep, does it with a fresh install

Submitted a patch that covers this and another issue.

Thanks for the patch Wulf.

Locked automatically