Skip to content

Patch ShipStatus.BreakEmergencyButton with custom LI logic. - #64

Closed
PalmForest0 wants to merge 2 commits into
DigiWorm0:masterfrom
PalmForest0:emergency-button-fix
Closed

Patch ShipStatus.BreakEmergencyButton with custom LI logic.#64
PalmForest0 wants to merge 2 commits into
DigiWorm0:masterfrom
PalmForest0:emergency-button-fix

Conversation

@PalmForest0

Copy link
Copy Markdown
Contributor

I ran into an issue while developing another mod, where the game screen would be mostly obstructed and the console would yield the following error in the Hide and Seek game mode:

Screenshot_1
[Error  :Il2CppInterop] Exception in IL2CPP-to-Managed trampoline, not passing it to il2cpp: Il2CppInterop.Runtime.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object.
--- BEGIN IL2CPP STACK TRACE ---
System.NullReferenceException: Object reference not set to an instance of an object.
  at ShipStatus.BreakEmergencyButton () [0x00000] in <00000000000000000000000000000000>:0
--- END IL2CPP STACK TRACE ---

   at Il2CppInterop.Runtime.Il2CppException.RaiseExceptionIfNecessary(IntPtr returnedException) in /home/runner/work/Il2CppInterop/Il2CppInterop/Il2CppInterop.Runtime/Il2CppException.cs:line 36
   at ShipStatus.BreakEmergencyButton()
   at CrewmeleonRedrawn.GameMode.ChameleonIntro.Play(IntroCutscene intro)+MoveNext()
   at Trampoline_ByteThisBepInEx.Unity.IL2CPP.Utils.Collections.Il2CppManagedEnumeratorMoveNext(IntPtr , Il2CppMethodInfo* )

I then applied a quick patch that cancels the original logic, and instead manually searches for all emergency buttons on the map. I recognise the potential performance issues of my basic approach, but it's probably best if you decide whether you want to store all SystemConsole instances in a builder or do something else. My goal was to make you aware of this issue and provide a potential fix, so here you go :).

Sidenote: I also noticed an issue while trying to build the project caused by my previous custom dummy names feature being partially reverted, so I added back the missing sections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant