From c9c2a7532877140eb8e800beb7e732e72c8563b0 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 12 Jun 2026 11:07:45 +0800 Subject: [PATCH] =?UTF-8?q?SimulationEngine=20cleanup:=20=E5=88=A0?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E5=BC=B9=E8=8D=AFfallback=20+=20?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=AB=98=E5=BA=A6=E7=94=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CounterDrone.Core/Simulation/SimulationEngine.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CounterDrone.Core/Simulation/SimulationEngine.cs b/src/CounterDrone.Core/Simulation/SimulationEngine.cs index e72d02f..c1c316f 100644 --- a/src/CounterDrone.Core/Simulation/SimulationEngine.cs +++ b/src/CounterDrone.Core/Simulation/SimulationEngine.cs @@ -41,6 +41,7 @@ namespace CounterDrone.Core.Simulation private List _zones = new(); private CombatScene _scene = new(); + private float _disperseHeight = 300f; private AmmunitionSpec _ammoSpec = new(); private int _tickRate = 20; @@ -82,6 +83,7 @@ namespace CounterDrone.Core.Simulation if (config == null) throw new InvalidOperationException("Task not found"); _scene = config.Scene; + _disperseHeight = (float)config.Cloud.DisperseHeight; _tickRate = config.Task.TickRate; _tickInterval = 1.0f / _tickRate; @@ -157,8 +159,7 @@ namespace CounterDrone.Core.Simulation platform.AerosolType ?? Models.AerosolType.InertGas, platform.PosX, platform.PosY, platform.PosZ, fe.TargetX, fe.TargetY, fe.TargetZ, - fe.MuzzleVelocity, - (float)_ammoSpec.InitialRadius > 0 ? 300f : 300f); + fe.MuzzleVelocity, _disperseHeight); _munitions.Add(m); frameEvents.Add(new SimEvent {