mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
SA: Reset bPenaltyForDeathApplies and bPenaltyForArrestApplies on new game (SA 1.0 only for now)
This commit is contained in:
parent
4959204f53
commit
c803927c80
1 changed files with 17 additions and 1 deletions
|
@ -1403,7 +1403,20 @@ namespace VariableResets
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using VarVariant = std::variant<bool*, int*, TimeNextMadDriverChaseCreated_t<float>*>;
|
template<typename T, T val>
|
||||||
|
struct ResetToValue_t
|
||||||
|
{
|
||||||
|
T m_value;
|
||||||
|
|
||||||
|
ResetToValue_t()
|
||||||
|
: m_value(val)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
using ResetToTrue_t = ResetToValue_t<bool, true>;
|
||||||
|
|
||||||
|
using VarVariant = std::variant< bool*, int*, TimeNextMadDriverChaseCreated_t<float>*, ResetToTrue_t* >;
|
||||||
std::vector<VarVariant> GameVariablesToReset;
|
std::vector<VarVariant> GameVariablesToReset;
|
||||||
|
|
||||||
static void (*orgReInitGameObjectVariables)();
|
static void (*orgReInitGameObjectVariables)();
|
||||||
|
@ -4158,6 +4171,9 @@ void Patch_SA_10()
|
||||||
|
|
||||||
// Non-zero inits still need to be done
|
// Non-zero inits still need to be done
|
||||||
GameVariablesToReset.emplace_back( *(TimeNextMadDriverChaseCreated_t<float>**)(0x421369 + 2) ); // CCarCtrl::TimeNextMadDriverChaseCreated
|
GameVariablesToReset.emplace_back( *(TimeNextMadDriverChaseCreated_t<float>**)(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!
|
// Don't clean the car BEFORE Pay 'n Spray doors close, as it gets cleaned later again anyway!
|
||||||
|
|
Loading…
Reference in a new issue