Update Quit Method

This commit is contained in:
CWX 2024-11-02 17:03:54 +00:00
parent 07900a46cf
commit bb2c43e9ec

View File

@ -32,7 +32,7 @@ public class MethodHelper
} }
/// <summary> /// <summary>
/// Method to get Quit method from EFT (as of 20/05/2024 - GClass1955) /// Method to get Quit method from EFT (as of 02/11/2024 - GClass2193)
/// </summary> /// </summary>
/// <returns>MethodInfo</returns> /// <returns>MethodInfo</returns>
public static MethodInfo GetApplicationQuitMethod() public static MethodInfo GetApplicationQuitMethod()
@ -40,8 +40,11 @@ public class MethodHelper
try try
{ {
return DataHelper._eftAssembly.GetTypes().First(x => return DataHelper._eftAssembly.GetTypes().First(x =>
x.GetMethods().Any(y => {
y.Name == "Quit") var methods = x.GetMethods();
return methods.Any(m => m.Name == "Quit") && methods.Any(m => m.Name == "QuitWithCode");
}
).GetMethod("Quit"); ).GetMethod("Quit");
} }
catch (Exception e) catch (Exception e)