Skip to content

Commit

Permalink
v1.0.4.6 General cleanup & potential bug fixes
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Saltyq committed Nov 27, 2019
1 parent 99c19c2 commit 33db096
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
13 changes: 3 additions & 10 deletions source/core/DllMain.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
bool sGameReloaded = false;

#pragma managed
#include <stdio.h> /* defines FILENAME_MAX */
#define WINDOWS
#ifdef WINDOWS
#include <direct.h>
#define GetCurrentDir _getcwd
#endif
#include<iostream>

// Import C# code base
Expand All @@ -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:
Expand Down Expand Up @@ -120,7 +118,6 @@ public ref class ScriptHookRDRDotNet
}

};
bool devConfig;
static void ScriptHookRDRDotNet_ManagedInit()
{
RDR2DN::Console^% console = ScriptHookRDRDotNet::console;
Expand Down Expand Up @@ -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"));

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



PVOID sGameFiber = nullptr;
PVOID sScriptFiber = nullptr;


static void ScriptMain()
{
sGameReloaded = true;
Expand Down
2 changes: 1 addition & 1 deletion source/core/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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", " ");
Expand Down
4 changes: 2 additions & 2 deletions source/scripting_v3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
3 changes: 2 additions & 1 deletion source/scripting_v3/ScriptHookRDRDotNet_API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RDR2</RootNamespace>
<AssemblyName>ScriptHookRDRNetAPI</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<OutputPath>..\..\bin\Debug\</OutputPath>
Expand Down

0 comments on commit 33db096

Please sign in to comment.