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

View File

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