diff --git a/src/RustToDust.Ymir/ArenaSession.cs b/src/RustToDust.Ymir/ArenaSession.cs index f71ba7d..6b84a48 100644 --- a/src/RustToDust.Ymir/ArenaSession.cs +++ b/src/RustToDust.Ymir/ArenaSession.cs @@ -73,6 +73,7 @@ namespace RustToDust.Ymir public MatchState State { get; } public Box3DSoaWorld World => _world; + public bool EnableNetworkPvs { get; set; } = true; public void SetHumanSlot(int contenderId, bool isHuman, string? callsign = null) { @@ -1744,7 +1745,7 @@ namespace RustToDust.Ymir } } - _contenderPvs[obs.Id, i] = obsSees || ComputeConservativePvs(obs, pEyeY, c.X, c.Y, c.Z, c.Grid.Spec); + _contenderPvs[obs.Id, i] = !EnableNetworkPvs || obsSees || ComputeConservativePvs(obs, pEyeY, c.X, c.Y, c.Z, c.Grid.Spec); if (distSqC <= 240f * 240f && HasLineOfSight(c.X, MatchRules.GetObserverEyeY(c.Y, c.Grid.Spec.HalfHeight), c.Z, obs.X, pTargetY, obs.Z)) @@ -1801,7 +1802,10 @@ namespace RustToDust.Ymir mem.FaintHorizonPing = horizonPing; } - _spectatorPvs[obs.Id, i] = obsSees || ComputeConservativePvs(obs, pEyeY, s.X, s.Y, s.Z, s.Grid.Spec); + _spectatorPvs[obs.Id, i] = !EnableNetworkPvs || + obsSees || + ((s.Stance != SpectatorStance.Neutral || sDistSq <= 260f * 260f) && + ComputeConservativePvs(obs, pEyeY, s.X, s.Y, s.Z, s.Grid.Spec)); if (s.Stance != SpectatorStance.Neutral && s.TargetContenderId == obs.Id && diff --git a/src/RustToDust.Ymir/LocalArenaSession.cs b/src/RustToDust.Ymir/LocalArenaSession.cs index 53f59d2..8bdd91b 100644 --- a/src/RustToDust.Ymir/LocalArenaSession.cs +++ b/src/RustToDust.Ymir/LocalArenaSession.cs @@ -11,7 +11,10 @@ namespace RustToDust.Ymir public LocalArenaSession(int seed = 42, ArenaMapKind mapKind = ArenaMapKind.Desert, string? callsign = null) { - Inner = new ArenaSession(seed, mapKind, slot0Human: true); + Inner = new ArenaSession(seed, mapKind, slot0Human: true) + { + EnableNetworkPvs = false + }; if (!string.IsNullOrWhiteSpace(callsign)) { Inner.SetHumanSlot(0, true, callsign); @@ -87,7 +90,10 @@ namespace RustToDust.Ymir string? name = LocalContender.Name; _pendingEvents.Clear(); Inner.Dispose(); - Inner = new ArenaSession(seed, mapKind, slot0Human: true); + Inner = new ArenaSession(seed, mapKind, slot0Human: true) + { + EnableNetworkPvs = false + }; if (!string.IsNullOrWhiteSpace(name)) { Inner.SetHumanSlot(0, true, name);