feat(extra-natives-rdr3): Allow scenario usage without gender check
Goal of this PR
Add server-controlled ConVars to bypass scenario gender checks in RDR3, allowing players to use scenarios regardless of their character's gender.
How is this PR achieving the goal
This PR implements two new replicated ConVars (sv_skipScenarioMaleCheck and sv_skipScenarioFemaleCheck) that allow server administrators to disable gender-based scenario restrictions. When enabled, these ConVars bypass the internal AI condition checks for male and female scenarios, allowing any player to use scenarios regardless of their character's gender.
The implementation:
- Adds client-side ConVars with
ConVar_Replicatedflag that automatically sync with server values - Hooks into the
CAIConditionIsMaleandCAIConditionIsFemalefunctions to check the ConVar values - Returns
true(allowing scenario usage) when the respective ConVar is enabled, otherwise calls the original function - Uses trampoline hooks to intercept the original game functions
This PR applies to the following area(s)
RedM, Server, Client, Natives
Successfully tested on
Game builds: RDR3 1491
Platforms: Windows
Checklist
- [x] Code compiles and has been tested successfully.
- [x] Code explains itself well and/or is documented.
- [x] My commit message explains what the changes do and what they are for.
- [x] No extra compilation warnings are added by these changes.
would be nice to see something for the MP_MOONSHINE_BAND_ scenarios, too
they are locked by Condition type="CAIConditionIsInNetworkSession" which seems to be not given.
foundable in "Red Dead Redemption 2\update_1.rpf\common\data\ai\scenarios\amb_misc.meta"