Skip to content

Restore broken cheats, fix hotkey, and optimize ESP for current SOTF/BepInEx - #36

Open
CrossiiDev-Studio wants to merge 1 commit into
Wolf11221:mainfrom
CrossiiDev-Studio:main
Open

Restore broken cheats, fix hotkey, and optimize ESP for current SOTF/BepInEx#36
CrossiiDev-Studio wants to merge 1 commit into
Wolf11221:mainfrom
CrossiiDev-Studio:main

Conversation

@CrossiiDev-Studio

Copy link
Copy Markdown

Maintenance update for current Sons of the Forest / BepInEx 6 IL2CPP builds: restore broken cheats, fix unreliable menu hotkey behavior (especially on German keyboards), harden cheat cleanup when leaving a world, and reduce ESP/UI allocation overhead.

Fixes
Menu hotkey — Default set to Backslash (German ^ key). Also accepts BackQuote / Caret. Input is checked before cheat updates and again in OnGUI, so exceptions in cheats cannot block opening the menu.
IL2CPP lifecycle — Added proper IntPtr constructor for SotfMain and safer GameObject setup; added startup/toggle logs for debugging.
World exit cleanup — Cheats with side effects now truly disable (SpeedyRun console, Instant/Infinite Build, CaveLight, NoCold, NoFallDamage, GodMode max health, held-item hack) instead of only clearing Enabled flags.
Infinite Ammo — Restored by refilling the held ranged weapon magazine via RangedWeaponItemInstanceModule.
Infinite Logs — Restored via HeldOnlyItemController.InfiniteHack, synced with Infinite Build so the toggles do not override each other incorrectly.
No Fall Damage — Applied on toggle instead of every-frame polling.
Performance
ESP — Early exit when no category is active; actor labels use lookup maps instead of large switches; shared GUIContent + cached distance strings to reduce GC.
ESP UX — Turning off the master ESP toggle no longer clears category selections every frame.
Item ID window — Rebuilds the filtered list only when the search query changes.
Update loop — Removed empty/broken update calls from the hot path.
Docs / build
README updated with fork changelog, corrected config path (SOTF_ModMenu.cfg), and build notes.
Optional post-build copy to BepInEx/plugins (only if the target folder exists).
Test plan
Open/close menu with ^ (Backslash) on a German keyboard; confirm log lines SotfMain started / Mod menu opened
Toggle Infinite Ammo with a ranged weapon equipped; magazine stays full while firing
Toggle Infinite Logs / Infinite Build; held logs/sticks are not consumed; disabling one does not break the other if still enabled
Enable SpeedyRun / CaveLight / GodMode, return to main menu; side effects are cleared
Enable ESP categories, disable master ESP, re-enable; category selections remain
Open “Show all ID’s”, type a search; no hitching / list updates only on query change

Optimize ESP and UI hot paths, fix menu hotkey on German layouts, properly disable cheat side effects on world exit, and document the fork changes in the README.
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