Dictionary<K,V>.Remove and HashSet<T>.Remove do not bump the collection version, so removing during a foreach is safe and the collect-then-remove queues guarding those loops are dead weight. This drops them, including via the Keys and Values enumerators. Deletion of a Mobile is left deferred: removing from World.Mobiles while enumerating it is fine, but Delete() runs OnDelete/OnAfterDelete, the OnParentDeleted cascade over the pack, and region and guild callbacks. Anything in there that constructs a Mobile is an Add into the dictionary being enumerated, which does invalidate it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| Application | ||
| BuildTool | ||
| Logger | ||
| Server | ||
| Server.Tests | ||
| UOContent | ||
| UOContent.Tests | ||