Skip to content

Commit 8547858

Browse files
committed
fixed issue where the cheat flag wasn't enabled when turnign a cheat mod on mid simulation
1 parent ec1932c commit 8547858

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

PolyTechMain.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public void Awake()
124124
private void Update()
125125
{
126126
PopupQueue.TryShowNextPopup();
127+
if (numEnabledCheatMods() > 0 && Bridge.IsSimulating() && !BridgeCheat.m_Cheated){
128+
GameStateSim.m_BudgetUsed = Mathf.RoundToInt(Budget.CalculateBridgeCost());
129+
BridgeCheat.m_Cheated = BridgeCheat.CheckForCheating((float)GameStateSim.m_BudgetUsed);
130+
}
127131
if (!flag && globalToggleHotkey.Value.IsDown())
128132
{
129133
flag = true;
@@ -360,6 +364,7 @@ private class patchGameStart
360364
[HarmonyPrefix]
361365
private static bool PatchCheats(ref bool __result)
362366
{
367+
ptfInstance.Logger.LogInfo("checking cheats");
363368
__result = true;
364369
ptfInstance.modCheated = ptfInstance.modCheated || (modEnabled.Value && numEnabledCheatMods() > 0) || (PolyTechMain.modEnabled.Value && enabledCheatTweaks > 0);
365370
return !ptfInstance.modCheated;

0 commit comments

Comments
 (0)