From 0c7158bdca5b6e5f4ccdcbd01d18b46362f36960 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Sun, 16 Apr 2023 17:35:13 +0200 Subject: [PATCH] fixed nullptr exception in BurnRitualObj --- DevourClient/Hacks/Misc.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index 678df13..ce4baf0 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -67,11 +67,14 @@ namespace DevourClient.Hacks public static void BurnRitualObj(string map, bool burnAll) { - //map controllers SHOULDN'T be null but we never know, if smth break, add a nullptr check switch (map) { case "Inn": Il2Cpp.InnMapController _innMapController = UnityEngine.Object.FindObjectOfType(); + if (!_innMapController) { + return; + } + if (burnAll){ _innMapController.SetProgressTo(10); } @@ -82,6 +85,9 @@ namespace DevourClient.Hacks case "Slaughterhouse": Il2Cpp.SlaughterhouseAltarController _slaughterhouseAltarController = UnityEngine.Object.FindObjectOfType(); + if (!_slaughterhouseAltarController) { + return; + } if (burnAll) { @@ -95,6 +101,10 @@ namespace DevourClient.Hacks default: Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType(); + if (!_altar) { + return; + } + if (burnAll) { _altar.SkipToGoat(10);