Fix CLI error and hollower
This commit is contained in:
parent
7bb245d754
commit
180a010d82
@ -1,5 +1,4 @@
|
|||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
|
||||||
using Mono.Cecil.Rocks;
|
using Mono.Cecil.Rocks;
|
||||||
using ReCodeIt.CrossCompiler;
|
using ReCodeIt.CrossCompiler;
|
||||||
using ReCodeIt.Enums;
|
using ReCodeIt.Enums;
|
||||||
@ -346,28 +345,6 @@ public class ReCodeItRemapper
|
|||||||
|
|
||||||
// Remove existing instructions
|
// Remove existing instructions
|
||||||
ilProcessor.Clear();
|
ilProcessor.Clear();
|
||||||
|
|
||||||
if (method.ReturnType.FullName != "System.Void")
|
|
||||||
{
|
|
||||||
// Return appropriate default value based on return type
|
|
||||||
if (method.ReturnType.IsValueType)
|
|
||||||
{
|
|
||||||
// Load 0 onto the stack (works for most value types)
|
|
||||||
ilProcessor.Emit(OpCodes.Ldc_I4_0);
|
|
||||||
|
|
||||||
// Convert to Int64 if needed
|
|
||||||
if (method.ReturnType.FullName == "System.Int64")
|
|
||||||
ilProcessor.Emit(OpCodes.Conv_I8);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Load null for reference types
|
|
||||||
ilProcessor.Emit(OpCodes.Ldnull);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add a return instruction
|
|
||||||
ilProcessor.Emit(OpCodes.Ret);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,13 @@ public static class DataProvider
|
|||||||
|
|
||||||
Settings = JsonConvert.DeserializeObject<Settings>(jsonText, settings);
|
Settings = JsonConvert.DeserializeObject<Settings>(jsonText, settings);
|
||||||
|
|
||||||
|
if (Settings is null)
|
||||||
|
{
|
||||||
|
Logger.Log("Settings were null, creating new settings", ConsoleColor.Red);
|
||||||
|
Settings = CreateFakeSettings();
|
||||||
|
SaveAppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
Logger.Log($"Settings loaded from '{settingsPath}'");
|
Logger.Log($"Settings loaded from '{settingsPath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,6 +92,7 @@ public static class DataProvider
|
|||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
{
|
{
|
||||||
Logger.Log($"Error loading mapping.json from `{path}`, First time running? Please select a mapping path in the gui", ConsoleColor.Red);
|
Logger.Log($"Error loading mapping.json from `{path}`, First time running? Please select a mapping path in the gui", ConsoleColor.Red);
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonText = File.ReadAllText(path);
|
var jsonText = File.ReadAllText(path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user