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!