Skip to content

Commit 33db096

Browse files
committed
v1.0.4.6 General cleanup & potential bug fixes
General cleanup & attempt to solve errors loading .asi file for some users. Added diagnostics program for these reports (Thanks MoosheTV!) Changed target framework to v4.5.2 (possible that v4.8 was causing issues before, this is just a debug run, if this is not the issue then the framework will be put back to v4.8)
1 parent 99c19c2 commit 33db096

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

source/core/DllMain.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
bool sGameReloaded = false;
2-
31
#pragma managed
42
#include <stdio.h> /* defines FILENAME_MAX */
53
#define WINDOWS
6-
#ifdef WINDOWS
74
#include <direct.h>
85
#define GetCurrentDir _getcwd
9-
#endif
106
#include<iostream>
117

128
// Import C# code base
@@ -21,11 +17,13 @@ namespace WinForms = System::Windows::Forms;
2117
[assembly:AssemblyProductAttribute("ScriptHookRDRDotNet")];
2218
[assembly:AssemblyDescriptionAttribute("An ASI plugin for Red Dead Redemption 2, which allows running scripts written in any .NET language in-game.")];
2319
[assembly:AssemblyVersionAttribute("1.0.0.0")];
24-
[assembly:AssemblyCopyrightAttribute("Copyright © 2015 crosire | Copyright © 2019 SaltyDev")];
20+
[assembly:AssemblyCopyrightAttribute("Copyright © 2015 crosire | Copyright © 2019 Salty")];
2521
// Sign with a strong name to distinguish from older versions and cause .NET framework runtime to bind the correct assemblies
2622
// 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)
2723
[assembly:AssemblyKeyFileAttribute("PublicKeyToken.snk")];
2824

25+
bool sGameReloaded = false;
26+
2927
public ref class ScriptHookRDRDotNet
3028
{
3129
public:
@@ -120,7 +118,6 @@ public ref class ScriptHookRDRDotNet
120118
}
121119

122120
};
123-
bool devConfig;
124121
static void ScriptHookRDRDotNet_ManagedInit()
125122
{
126123
RDR2DN::Console^% console = ScriptHookRDRDotNet::console;
@@ -157,7 +154,6 @@ static void ScriptHookRDRDotNet_ManagedInit()
157154
else if (data[0] == "ScriptsLocation")
158155
scriptPath = data[1];
159156
}
160-
devConfig = IO::File::Exists(IO::Path::ChangeExtension(Assembly::GetExecutingAssembly()->Location, ".dev"));
161157

162158
RDR2DN::Log::Message(RDR2DN::Log::Level::Info, "Config loaded from ", IO::Path::ChangeExtension(Assembly::GetExecutingAssembly()->Location, ".ini"));
163159

@@ -267,12 +263,9 @@ static void ScriptHookRDRDotNet_ManagedKeyboardMessage(unsigned long keycode, bo
267263
#include <Windows.h>
268264
#include <WinBase.h>
269265

270-
271-
272266
PVOID sGameFiber = nullptr;
273267
PVOID sScriptFiber = nullptr;
274268

275-
276269
static void ScriptMain()
277270
{
278271
sGameReloaded = true;

source/core/Script.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void Start()
139139

140140
unsafe
141141
{
142-
while (firstTime)
142+
if (firstTime)
143143
{
144144
NativeFunc.Invoke(0x4170B650590B3B00, 0.1f, 0.1f);
145145
var res = NativeFunc.Invoke(0xFA925AC00EB830B9, 10, "LITERAL_STRING", " ");

source/scripting_v3/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("1.0.4.5")]
32-
[assembly: AssemblyFileVersion("1.0.4.5")]
31+
[assembly: AssemblyVersion("1.0.4.6")]
32+
[assembly: AssemblyFileVersion("1.0.4.6")]

source/scripting_v3/ScriptHookRDRDotNet_API.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>RDR2</RootNamespace>
1111
<AssemblyName>ScriptHookRDRNetAPI</AssemblyName>
12-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
1415
</PropertyGroup>
1516
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
1617
<OutputPath>..\..\bin\Debug\</OutputPath>

0 commit comments

Comments
 (0)