EW 3 tests: forbid by direct PresencePermitted (Update re-derives the security level); listed-once after a tick

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-17 07:04:46 +02:00
commit 8a779b3aa8
2 changed files with 6 additions and 3 deletions

View file

@ -9,6 +9,7 @@ using GameCult.Caching.MessagePack;
using MessagePack;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UniRx;
using Xunit;
using static CultMath.math;
using float2 = CultMath.float2;
@ -1764,7 +1765,7 @@ public sealed partial class ContactRevealTests : IDisposable
var e = Add(float3(0, 0, 100), new[] { "Gun" });
var o = Add(float3(0, 0, 0), new[] { "Eye" });
_zone.GalaxyZone.Owner = o.Faction;
e.CurrentSecurityLevel.Value = SecurityLevel.Critical;
Forbid(e);
var gun = Guns(e)[0];
Fire(e, gun);
ShowOnly(e, 1f, gun);
@ -1789,7 +1790,7 @@ public sealed partial class ContactRevealTests : IDisposable
var e = Add(float3(0, 0, 100), new[] { "Gun" });
var o = Add(float3(0, 0, 0), new[] { "Eye" });
_zone.GalaxyZone.Owner = o.Faction;
e.CurrentSecurityLevel.Value = SecurityLevel.Critical;
Forbid(e);
var gun = Guns(e)[0];
Fire(e, gun);
ShowOnly(e, 1f, gun);
@ -1814,7 +1815,7 @@ public sealed partial class ContactRevealTests : IDisposable
var e = Add(float3(0, 0, 100), new[] { "Gun" });
var o = Add(float3(0, 0, 0), new[] { "Eye" });
_zone.GalaxyZone.Owner = o.Faction;
e.CurrentSecurityLevel.Value = SecurityLevel.Critical;
Forbid(e);
var gun = Guns(e)[0];
Fire(e, gun);
ShowOnly(e, 1f, gun);

View file

@ -281,6 +281,8 @@ public sealed class IffAndCombatTests : IDisposable
Assert.Null(none); // received, and it claims no faction
Assert.True(patrol.IsHostileTo(stranger));
Assert.Equal(1, patrol.VisibleEnemies.Count(e => e == stranger)); // filed hostile at once, listed once
zone.Update(.01f);
Assert.Equal(1, patrol.VisibleEnemies.Count(e => e == stranger)); // still listed once after the per-tick refresh
Assert.DoesNotContain(stranger, patrol.VisibleFriendlies);
}