This commit is contained in:
2025-07-17 02:57:50 +03:00
parent fb24fe0f7b
commit d8ed10b4be
2 changed files with 6 additions and 10 deletions

View File

@ -40,7 +40,6 @@ namespace DroneSimulator
public static bool TimeLimit = false; public static bool TimeLimit = false;
private Vector2 MoveOF = Vector2.Zero; private Vector2 MoveOF = Vector2.Zero;
private uint CountOF = 0;
private bool ReadyOF = false; private bool ReadyOF = false;
public struct Physics public struct Physics
@ -366,8 +365,7 @@ namespace DroneSimulator
lock (this) lock (this)
{ {
MoveOF += RealOF.result; MoveOF += RealOF.result * time;
CountOF += 1;
if (of) ReadyOF = true; if (of) ReadyOF = true;
} }
@ -533,10 +531,11 @@ namespace DroneSimulator
lock (this) lock (this)
{ {
if (ReadyOF && CountOF != 0) if (ReadyOF)
{ {
of.X = MoveOF.X / CountOF; of.X = MoveOF.X;
of.Y = MoveOF.Y / CountOF; of.Y = MoveOF.Y;
MoveOF = Vector2.Zero;
} }
else else
{ {
@ -546,8 +545,6 @@ namespace DroneSimulator
of.Time = RealOF.timer; of.Time = RealOF.timer;
MoveOF = Vector2.Zero;
CountOF = 0;
ReadyOF = false; ReadyOF = false;
} }

View File

@ -332,12 +332,11 @@ namespace DroneSimulator
return true; return true;
} }
v = laten[index]; result = laten[index];
uint freq = 1000 / Freq; uint freq = 1000 / Freq;
if (timer + freq <= time) if (timer + freq <= time)
{ {
result = v;
timer = time; timer = time;
return true; return true;
} }