diff --git a/source/core/DllMain.cpp b/source/core/DllMain.cpp index d3f7adc..2344927 100644 --- a/source/core/DllMain.cpp +++ b/source/core/DllMain.cpp @@ -1,12 +1,8 @@ -bool sGameReloaded = false; - #pragma managed #include /* defines FILENAME_MAX */ #define WINDOWS -#ifdef WINDOWS #include #define GetCurrentDir _getcwd -#endif #include // Import C# code base @@ -21,11 +17,13 @@ namespace WinForms = System::Windows::Forms; [assembly:AssemblyProductAttribute("ScriptHookRDRDotNet")]; [assembly:AssemblyDescriptionAttribute("An ASI plugin for Red Dead Redemption 2, which allows running scripts written in any .NET language in-game.")]; [assembly:AssemblyVersionAttribute("1.0.0.0")]; -[assembly:AssemblyCopyrightAttribute("Copyright © 2015 crosire | Copyright © 2019 SaltyDev")]; +[assembly:AssemblyCopyrightAttribute("Copyright © 2015 crosire | Copyright © 2019 Salty")]; // Sign with a strong name to distinguish from older versions and cause .NET framework runtime to bind the correct assemblies // There is no version check performed for assemblies without strong names (https://docs.microsoft.com/en-us/dotnet/framework/deployment/how-the-runtime-locates-assemblies) [assembly:AssemblyKeyFileAttribute("PublicKeyToken.snk")]; +bool sGameReloaded = false; + public ref class ScriptHookRDRDotNet { public: @@ -120,7 +118,6 @@ public ref class ScriptHookRDRDotNet } }; -bool devConfig; static void ScriptHookRDRDotNet_ManagedInit() { RDR2DN::Console^% console = ScriptHookRDRDotNet::console; @@ -157,7 +154,6 @@ static void ScriptHookRDRDotNet_ManagedInit() else if (data[0] == "ScriptsLocation") scriptPath = data[1]; } - devConfig = IO::File::Exists(IO::Path::ChangeExtension(Assembly::GetExecutingAssembly()->Location, ".dev")); RDR2DN::Log::Message(RDR2DN::Log::Level::Info, "Config loaded from ", IO::Path::ChangeExtension(Assembly::GetExecutingAssembly()->Location, ".ini")); @@ -267,12 +263,9 @@ static void ScriptHookRDRDotNet_ManagedKeyboardMessage(unsigned long keycode, bo #include #include - - PVOID sGameFiber = nullptr; PVOID sScriptFiber = nullptr; - static void ScriptMain() { sGameReloaded = true; diff --git a/source/core/Script.cs b/source/core/Script.cs index 3efedfa..ee7e9d0 100644 --- a/source/core/Script.cs +++ b/source/core/Script.cs @@ -139,7 +139,7 @@ public void Start() unsafe { - while (firstTime) + if (firstTime) { NativeFunc.Invoke(0x4170B650590B3B00, 0.1f, 0.1f); var res = NativeFunc.Invoke(0xFA925AC00EB830B9, 10, "LITERAL_STRING", " "); diff --git a/source/scripting_v3/Properties/AssemblyInfo.cs b/source/scripting_v3/Properties/AssemblyInfo.cs index 988cc83..2e6b09c 100644 --- a/source/scripting_v3/Properties/AssemblyInfo.cs +++ b/source/scripting_v3/Properties/AssemblyInfo.cs @@ -28,5 +28,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.4.5")] -[assembly: AssemblyFileVersion("1.0.4.5")] +[assembly: AssemblyVersion("1.0.4.6")] +[assembly: AssemblyFileVersion("1.0.4.6")] diff --git a/source/scripting_v3/ScriptHookRDRDotNet_API.csproj b/source/scripting_v3/ScriptHookRDRDotNet_API.csproj index 006b80f..f6f3d50 100644 --- a/source/scripting_v3/ScriptHookRDRDotNet_API.csproj +++ b/source/scripting_v3/ScriptHookRDRDotNet_API.csproj @@ -9,8 +9,9 @@ Properties RDR2 ScriptHookRDRNetAPI - v4.8 + v4.5.2 512 + ..\..\bin\Debug\