Skip to content

Commit

Permalink
fixed more sonarqube issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cranberry3148 committed Nov 27, 2023
1 parent 90cf8ff commit 370ff2f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions NadezdaUI/Gui/Framework/Utils/DeltaTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public class DeltaTime
/// <returns>A new instance of the DeltaTime class.</returns>
public static DeltaTime CreatePoint()
{
return new DeltaTime { FirstTime = DateTime.Now };
return new DeltaTime {
FirstTime = DateTime.UtcNow
};
}
/// <summary>
/// Calculates the time difference between the current time and the stored start time.
Expand All @@ -26,9 +28,8 @@ public TimeSpan GetDeltaTime()

if(FirstTime != null)

Check warning on line 29 in NadezdaUI/Gui/Framework/Utils/DeltaTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

The result of the expression is always 'true' since a value of type 'DateTime' is never equal to 'null' of type 'DateTime?'
{

return DateTime.Now - FirstTime;
return DateTime.UtcNow - FirstTime;
}
return TimeSpan.FromSeconds(1 / 60); //If null then return 60 FPS.
return TimeSpan.FromSeconds((double)1 / 60); //If null then return 60 FPS.
}
}

0 comments on commit 370ff2f

Please sign in to comment.