fix(bridge): the ZoneManager helper copies the player list without ToArray
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 10s

Found compiling on the rust-oxide rig: BasePlayer.activePlayerList is
Facepunch's ListHashSet, which has no ToArray, so the helper did not compile.
It now copies into a List, which it needs anyway: entering a player can eject
or kill them and change the live list mid-loop. HarmonyLib itself resolved on
Oxide with no reference directive, and the helper patched ZoneManager 3.1.14 on
both frameworks once this compiled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-09-26 21:43:22 -05:00
parent 586ad7ceba
commit d1d4a00d1d

View File

@@ -292,7 +292,9 @@ namespace Oxide.Plugins
int entered = 0;
foreach (BasePlayer player in BasePlayer.activePlayerList.ToArray())
// A copy: entering a player can eject or kill them, which changes the live list.
// `activePlayerList` is Facepunch's ListHashSet, which has no ToArray.
foreach (BasePlayer player in new List<BasePlayer>(BasePlayer.activePlayerList))
{
if (player == null || player.IsNpc || player.transform == null)
continue;