Skip to content

Commit

Permalink
[m] rm redundant variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacky720 committed Feb 14, 2023
1 parent e1df10b commit 659190f
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions UndertaleModLib/UndertaleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,22 +460,17 @@ public void SetGMS2Version(uint major, uint minor = 0, uint release = 0, uint bu
/// <returns>Whether the version of the data file is the same or higher than a specified version.</returns>
public bool IsVersionAtLeast(uint major, uint minor = 0, uint release = 0, uint build = 0)
{
uint gameMajor = GeneralInfo.Major;
uint gameMinor = GeneralInfo.Minor;
uint gameRelease = GeneralInfo.Release;
uint gameBuild = GeneralInfo.Build;
if (GeneralInfo.Major != major)
return (GeneralInfo.Major > major);

if (gameMajor != major)
return (gameMajor > major);
if (GeneralInfo.Minor != minor)
return (GeneralInfo.Minor > minor);

if (gameMinor != minor)
return (gameMinor > minor);
if (GeneralInfo.Release != release)
return (GeneralInfo.Release > release);

if (gameRelease != release)
return (gameRelease > release);

if (gameBuild != build)
return (gameBuild > build);
if (GeneralInfo.Build != build)
return (GeneralInfo.Build > build);

return true; // The version is exactly what supplied.
}
Expand Down

0 comments on commit 659190f

Please sign in to comment.