From 7a53e1d32fcf7c8d9386df37cd9245255be6c59d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 12 May 2021 01:34:40 +0200 Subject: [PATCH] Fix command registration --- TechbloxModdingAPI/Commands/CommandPatch.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TechbloxModdingAPI/Commands/CommandPatch.cs b/TechbloxModdingAPI/Commands/CommandPatch.cs index d098948..6beb7f7 100644 --- a/TechbloxModdingAPI/Commands/CommandPatch.cs +++ b/TechbloxModdingAPI/Commands/CommandPatch.cs @@ -2,11 +2,11 @@ using System.Reflection; using HarmonyLib; -using Svelto.Context; using Svelto.ECS; using RobocraftX.CR.MainGame; using RobocraftX.Multiplayer; using RobocraftX.StateSync; +using TechbloxModdingAPI.Utility; namespace TechbloxModdingAPI.Commands { @@ -26,6 +26,7 @@ namespace TechbloxModdingAPI.Commands var entityFunctions = enginesRoot.GenerateEntityFunctions(); var entityFactory = enginesRoot.GenerateEntityFactory(); var entitySerializer = enginesRoot.GenerateEntitySerializer(); + Logging.MetaDebugLog("Adding existing command engines"); enginesRoot.AddEngine((IEngine) Activator.CreateInstance( AccessTools.TypeByName("RobocraftX.GUI.CommandLine.ExecuteSetGravityCommandEngine"))); enginesRoot.AddEngine((IEngine) Activator.CreateInstance( @@ -92,6 +93,7 @@ namespace TechbloxModdingAPI.Commands AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DamageCharacterCommandEngine"), entityFactory)); enginesRoot.AddEngine((IEngine) Activator.CreateInstance( AccessTools.TypeByName("RobocraftX.GUI.CommandLine.DisableCharacterDamageCommandEngine"))); + Logging.MetaDebugLog("Existing command engines added"); CommandManager.RegisterEngines(enginesRoot); } @@ -99,7 +101,7 @@ namespace TechbloxModdingAPI.Commands public static MethodInfo TargetMethod() { return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose") - .MakeGenericMethod(typeof(UnityContext)); + .MakeGenericMethod(typeof(object)); } } } \ No newline at end of file