mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 06:43:01 +05:00
SA: Disallow moving cam up/down with mouse when looking back/left/right in vehicle (1.0 only for now)
This commit is contained in:
parent
51aec1955f
commit
1d007aed68
1 changed files with 27 additions and 0 deletions
|
@ -1669,6 +1669,21 @@ namespace MoonphasesFix
|
|||
}
|
||||
}
|
||||
|
||||
// ============= Disallow moving cam up/down with mouse when looking back/left/right in vehicle =============
|
||||
namespace FollowCarMouseCamFix
|
||||
{
|
||||
static uint32_t& camLookDirection = **AddressByVersion<uint32_t**>( 0x525526 + 2, 0, 0 );
|
||||
static void* (*orgGetPad)(int);
|
||||
static bool* orgUseMouse3rdPerson;
|
||||
|
||||
static bool useMouseAndLooksForwards;
|
||||
static void* getPadAndSetFlag( int padNum )
|
||||
{
|
||||
useMouseAndLooksForwards = *orgUseMouse3rdPerson && camLookDirection == 3;
|
||||
return orgGetPad( padNum );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// ============= LS-RP Mode stuff =============
|
||||
namespace LSRPMode
|
||||
|
@ -4238,6 +4253,18 @@ void Patch_SA_10()
|
|||
Patch<uint32_t>( 0x4C8010 + 4, 6 );
|
||||
|
||||
|
||||
// Disallow moving cam up/down with mouse when looking back/left/right in vehicle
|
||||
{
|
||||
using namespace FollowCarMouseCamFix;
|
||||
|
||||
orgUseMouse3rdPerson = *(bool**)(0x525615 + 1);
|
||||
Patch( 0x525615 + 1, &useMouseAndLooksForwards );
|
||||
|
||||
ReadCall( 0x5245E4, orgGetPad );
|
||||
InjectHook( 0x5245E4, getPadAndSetFlag );
|
||||
}
|
||||
|
||||
|
||||
#if FULL_PRECISION_D3D
|
||||
// Test - full precision D3D device
|
||||
Patch<uint8_t>( 0x7F672B+1, *(uint8_t*)(0x7F672B+1) | D3DCREATE_FPU_PRESERVE );
|
||||
|
|
Loading…
Reference in a new issue