From c803927c80bce103866f99f3ae36878750f6a283 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 23 Dec 2019 23:21:19 +0100 Subject: [PATCH] SA: Reset bPenaltyForDeathApplies and bPenaltyForArrestApplies on new game (SA 1.0 only for now) --- SilentPatchSA/SilentPatchSA.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index f639571..85c3b6d 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -1403,7 +1403,20 @@ namespace VariableResets } }; - using VarVariant = std::variant*>; + template + struct ResetToValue_t + { + T m_value; + + ResetToValue_t() + : m_value(val) + { + } + }; + + using ResetToTrue_t = ResetToValue_t; + + using VarVariant = std::variant< bool*, int*, TimeNextMadDriverChaseCreated_t*, ResetToTrue_t* >; std::vector GameVariablesToReset; static void (*orgReInitGameObjectVariables)(); @@ -4158,6 +4171,9 @@ void Patch_SA_10() // Non-zero inits still need to be done GameVariablesToReset.emplace_back( *(TimeNextMadDriverChaseCreated_t**)(0x421369 + 2) ); // CCarCtrl::TimeNextMadDriverChaseCreated + + GameVariablesToReset.emplace_back( *(ResetToTrue_t**)(0x4758A4 + 2) ); // CGameLogic::bPenaltyForDeathApplies + GameVariablesToReset.emplace_back( *(ResetToTrue_t**)(0x4758C4 + 1) ); // CGameLogic::bPenaltyForArrestApplies } // Don't clean the car BEFORE Pay 'n Spray doors close, as it gets cleaned later again anyway!