Skip to content

Commit df36af5

Browse files
committed
Attempted fixes from 29 January 2026
1 parent 03a46ee commit df36af5

7 files changed

Lines changed: 45 additions & 30 deletions

File tree

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "vendor/undertalemodtool-src"]
22
path = vendor/undertalemodtool-src
3-
url = https://github.com/Dobby233Liu/UndertaleModTool
4-
branch = 2024_11-null-entries-in-chunk-lists-hack
3+
url = https://github.com/UnderminersTeam/UndertaleModTool
4+
branch = master

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.0",
4+
"rollForward": "latestMajor",
5+
"allowPrerelease": true
6+
}
7+
}

gmsl-modapi/gmsl-modapi.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<LangVersion>11</LangVersion>
56
<RootNamespace>GMSL</RootNamespace>
67
<ImplicitUsings>enable</ImplicitUsings>
78
<Nullable>enable</Nullable>
Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
1+
using Underanalyzer.Compiler;
22
using UndertaleModLib;
3+
using UndertaleModLib.Compiler;
34
using UndertaleModLib.Models;
45

56
namespace GMSL.Hooker;
67

78
public static class GmlSafeExtensions {
8-
public static void ReplaceGmlSafe(this UndertaleCode code, string gmlCode, UndertaleData data) {
9-
try { code.ReplaceGML(gmlCode, data); }
10-
// UndertaleModLib is trying to write profile cache but fails, we don't care
11-
catch(Exception ex) {
12-
if(ex.Message.StartsWith("Error during writing of GML code to profile", StringComparison.InvariantCulture))
13-
return;
14-
throw;
15-
}
9+
public static void ReplaceGmlSafe(this UndertaleCode code, string gmlCode, UndertaleData data)
10+
{
11+
// CompileResult result = new();
12+
13+
var group = new CompileGroup(data);
14+
group.QueueCodeReplace(code, gmlCode);
15+
group.Compile();
16+
17+
// try { code.ReplaceGML(gmlCode, data); }
18+
// // UndertaleModLib is trying to write profile cache but fails, we don't care
19+
// catch(Exception ex) {
20+
// if(ex.Message.StartsWith("Error during writing of GML code to profile", StringComparison.InvariantCulture))
21+
// return;
22+
// throw;
23+
// }
1624
}
1725

18-
public static void AppendGmlSafe(this UndertaleCode code, string gmlCode, UndertaleData data) {
19-
try { code.AppendGML(gmlCode, data); }
20-
// UndertaleModLib is trying to write profile cache but fails, we don't care
21-
catch(Exception ex) {
22-
if(ex.Message.StartsWith("Error during writing of GML code to profile", StringComparison.InvariantCulture))
23-
return;
24-
throw;
25-
}
26-
}
26+
// public static void AppendGmlSafe(this UndertaleCode code, string gmlCode, UndertaleData data) {
27+
// try { code.AppendGML(gmlCode, data); }
28+
// // UndertaleModLib is trying to write profile cache but fails, we don't care
29+
// catch(Exception ex) {
30+
// if(ex.Message.StartsWith("Error during writing of GML code to profile", StringComparison.InvariantCulture))
31+
// return;
32+
// throw;
33+
// }
34+
// }
2735
}

gmsl-modapi/src/Hooker/UndertaleInstructionExtensions.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace GMSL.Hooker;
66

77
public static class UndertaleInstructionExtensions {
88
public static bool Match(this UndertaleInstruction left, UndertaleInstruction right) {
9+
left.
910
return left.Kind == right.Kind && UndertaleInstruction.GetInstructionType(left.Kind) switch {
1011
UndertaleInstruction.InstructionType.SingleTypeInstruction => left.MatchType(right),
1112
UndertaleInstruction.InstructionType.DoubleTypeInstruction => left.MatchType(right),
@@ -31,18 +32,16 @@ private static bool MatchPop(this UndertaleInstruction left, UndertaleInstructio
3132
left.Type1 == right.Type1 &&
3233
(left.Type1 == UndertaleInstruction.DataType.Int16 && left.SwapExtra == right.SwapExtra ||
3334
left.Type1 != UndertaleInstruction.DataType.Int16 && left.TypeInst == right.TypeInst &&
34-
left.Destination.Type == right.Destination.Type && left.Destination.Target == right.Destination.Target);
35+
left.ValueVariable.InstanceType == right.ValueVariable.InstanceType && left.ValueInt == right.ValueInt);
3536

3637
private static bool MatchPush(this UndertaleInstruction left, UndertaleInstruction right) =>
3738
left.Type1 == right.Type1 && left.Type1 switch {
3839
UndertaleInstruction.DataType.Int32 when
39-
left.Value is UndertaleInstruction.Reference<UndertaleFunction> leftRef &&
40-
right.Value is UndertaleInstruction.Reference<UndertaleFunction> rightRef => leftRef.Type ==
41-
rightRef.Type && leftRef.Target == rightRef.Target,
40+
left.ValueFunction is UndertaleFunction leftRef &&
41+
right.ValueFunction is UndertaleFunction rightRef => leftRef == rightRef,
4242
UndertaleInstruction.DataType.Variable when
43-
left.Value is UndertaleInstruction.Reference<UndertaleVariable> leftRef &&
44-
right.Value is UndertaleInstruction.Reference<UndertaleVariable> rightRef => leftRef.Type ==
45-
rightRef.Type && leftRef.Target == rightRef.Target,
43+
left.ValueVariable is UndertaleVariable leftRef &&
44+
right.ValueVariable is UndertaleVariable rightRef => leftRef == rightRef,
4645
UndertaleInstruction.DataType.Variable when
4746
left.Value is UndertaleResourceById<UndertaleString, UndertaleChunkSTRG> leftRef &&
4847
right.Value is UndertaleResourceById<UndertaleString, UndertaleChunkSTRG> rightRef =>

gmsl-patcher/gmsl-patcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<RootNamespace>gmsl_patcher</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

vendor/undertalemodtool-src

0 commit comments

Comments
 (0)