mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 06:43:01 +05:00
Patterns for SA newsteam variables
This commit is contained in:
parent
e0cc726099
commit
889daff459
7 changed files with 16 additions and 17 deletions
|
@ -9,7 +9,7 @@
|
|||
static void* EntityRender = AddressByVersion<void*>(0x534310, 0x5347B0, 0x545B30);
|
||||
WRAPPER void CEntity::Render() { VARJMP(EntityRender); }
|
||||
|
||||
static void* varEntityIsVisible = AddressByVersion<void*>( 0x536BC0, 0, 0 ); // TODO
|
||||
static void* varEntityIsVisible = AddressByVersion<void*>( 0x536BC0, Memory::PatternAndOffset("0B F6 41 1C 80 74 05 E9", -5) );
|
||||
WRAPPER bool CEntity::IsVisible() { VARJMP(varEntityIsVisible); }
|
||||
|
||||
static void* varInvertRaster = AddressByVersion<void*>(0x705660, 0x705E90, 0x7497A0);
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
static void* BaseModelInfoShutdown = AddressByVersion<void*>(0x4C4D50, 0x4C4DD0, 0x4CF590);
|
||||
WRAPPER void CBaseModelInfo::Shutdown() { VARJMP(BaseModelInfoShutdown); }
|
||||
|
||||
// static unsigned char* ms_currentCol = *AddressByVersion<unsigned char**>(0x4C84C8, 0x4C86C8, 0x4D2DC8);
|
||||
static void* varSetVehicleColour = AddressByVersion<void*>( 0x4C84B0, 0, 0 ); // TODO: DO
|
||||
static void* varSetVehicleColour = AddressByVersion<void*>( 0x4C84B0, 0x4C86B0, 0x4D2DB0 );
|
||||
WRAPPER void CVehicleModelInfo::SetVehicleColour( int32_t color1, int32_t color2, int32_t color3, int32_t color4 ) { VARJMP(varSetVehicleColour); }
|
||||
|
||||
RwTexture* (*CCustomCarPlateMgr::CreatePlateTexture)(const char* pText, signed char nDesign) = AddressByVersion<RwTexture*(*)(const char*,signed char)>(0x6FDEA0, 0x6FE6D0, 0x736AC0);
|
||||
|
@ -17,7 +16,6 @@ void (*CCustomCarPlateMgr::SetupMaterialPlatebackTexture)(RpMaterial* pMaterial,
|
|||
bool (*CCustomCarPlateMgr::GeneratePlateText)(char* pBuf, int nLen); // Read from InjectDelayedPatches
|
||||
|
||||
CBaseModelInfo** const ms_modelInfoPtrs = *AddressByVersion<CBaseModelInfo***>(0x509CB1, 0x4C0C96, 0x403DB7);
|
||||
const uint32_t m_numModelInfoPtrs = *AddressByVersion<uint32_t*>(0x4C5956+2, 0, 0);
|
||||
|
||||
|
||||
static RwTexture** const ms_aDirtTextures = *AddressByVersion<RwTexture***>( 0x5D5DCC + 3, 0, 0x5F259C + 3 );
|
||||
|
|
|
@ -323,7 +323,6 @@ public:
|
|||
};
|
||||
|
||||
extern CBaseModelInfo** const ms_modelInfoPtrs;
|
||||
extern const uint32_t m_numModelInfoPtrs;
|
||||
|
||||
void RemapDirt( CVehicleModelInfo* modelInfo, uint32_t dirtID );
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "StdAfxSA.h"
|
||||
#include "PlayerInfoSA.h"
|
||||
|
||||
uint8_t& PlayerInFocus = **AddressByVersion<uint8_t**>( 0x56E218 + 3, 0, 0 ); // TODO: DO
|
||||
CPlayerInfo* const Players = *AddressByVersion<CPlayerInfo**>( 0x56E225 + 2, 0, 0 );
|
||||
uint8_t& PlayerInFocus = **AddressByVersion<uint8_t**>( 0x56E218 + 3, Memory::PatternAndOffset("08 85 C0 79 07 0F B6 05 ? ? ? ? 69 C0 90 01 00 00 8B 80", 8) );
|
||||
CPlayerInfo* const Players = *AddressByVersion<CPlayerInfo**>( 0x56E225 + 2, Memory::PatternAndOffset("08 85 C0 79 07 0F B6 05 ? ? ? ? 69 C0 90 01 00 00 8B 80", 20) );
|
||||
|
||||
CPlayerPed* FindPlayerPed( int playerID )
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "StdAfxSA.h"
|
||||
#include "PoolsSA.h"
|
||||
|
||||
CObjectPool*& CPools::ms_pObjectPool = **AddressByVersion<CObjectPool***>(0x5A18B2 + 2, 0, 0); // TODO
|
||||
CObjectPool*& CPools::ms_pObjectPool = **AddressByVersion<CObjectPool***>(0x5A18B2 + 2, Memory::PatternAndOffset("8B 48 08 57 33 FF 89 45 F8 89 4D FC", -4) );
|
|
@ -1037,6 +1037,7 @@ bool ReadDoubleRearWheels(const wchar_t* pPath)
|
|||
return listedAny;
|
||||
}
|
||||
|
||||
// 1.0 ONLY!
|
||||
bool __stdcall CheckDoubleRWheelsList( void* modelInfo, uint8_t* handlingData )
|
||||
{
|
||||
static void* lastModelInfo = nullptr;
|
||||
|
@ -1045,7 +1046,8 @@ bool __stdcall CheckDoubleRWheelsList( void* modelInfo, uint8_t* handlingData )
|
|||
if ( modelInfo == lastModelInfo ) return lastResult;
|
||||
lastModelInfo = modelInfo;
|
||||
|
||||
int32_t modelID = std::distance( ms_modelInfoPtrs, std::find( ms_modelInfoPtrs, ms_modelInfoPtrs+m_numModelInfoPtrs, modelInfo ) );
|
||||
const uint32_t numModelInfoPtrs = *(uint32_t*)0x4C5956+2;
|
||||
int32_t modelID = std::distance( ms_modelInfoPtrs, std::find( ms_modelInfoPtrs, ms_modelInfoPtrs+numModelInfoPtrs, modelInfo ) );
|
||||
|
||||
auto it = std::find_if( doubleRearWheelsList.begin(), doubleRearWheelsList.end(), [modelID]( const auto& item ) {
|
||||
return item.first == modelID;
|
||||
|
@ -1072,7 +1074,7 @@ CVehicleModelInfo* __fastcall VehicleModelInfoCtor(CVehicleModelInfo* me)
|
|||
return me;
|
||||
}
|
||||
|
||||
static void (*RemoveFromInterestingVehicleList)(CVehicle*) = AddressByVersion<void(*)(CVehicle*)>( 0x423ED0, 0, 0 ); // TODO: DO
|
||||
static void (*RemoveFromInterestingVehicleList)(CVehicle*) = AddressByVersion<void(*)(CVehicle*)>( 0x423ED0, Memory::PatternAndOffset("39 10 75 06 C7 00 00 00 00 00 83 C0 04 49 75 F0 5D C3", -10) );
|
||||
static void (*orgRecordVehicleDeleted)(CVehicle*);
|
||||
static void RecordVehicleDeleted_AndRemoveFromVehicleList( CVehicle* vehicle )
|
||||
{
|
||||
|
@ -1083,11 +1085,11 @@ static void RecordVehicleDeleted_AndRemoveFromVehicleList( CVehicle* vehicle )
|
|||
static int currDisplayedSplash_ForLastSplash = 0;
|
||||
static void DoPCScreenChange_Mod()
|
||||
{
|
||||
static int& currDisplayedSplash = **AddressByVersion<int**>( 0x590B22 + 1, 0, 0 ); // TODO: DO
|
||||
static int& currDisplayedSplash = **AddressByVersion<int**>( 0x590B22 + 1, Memory::PatternAndOffset("8B 51 20 6A 01 6A 0C FF D2 83 C4 08 E8", 17 + 1) );
|
||||
|
||||
static const int numSplashes = [] () -> int {
|
||||
RwTexture** begin = *AddressByVersion<RwTexture***>( 0x590CB4 + 1, 0, 0 ); // TODO: DO
|
||||
RwTexture** end = *AddressByVersion<RwTexture***>( 0x590CCE + 2, 0, 0 ); // TODO: DO
|
||||
RwTexture** begin = *AddressByVersion<RwTexture***>( 0x590CB4 + 1, Memory::PatternAndOffset("8D 49 00 83 3E 00 74 07 8B CE E8", -5 + 1) );
|
||||
RwTexture** end = *AddressByVersion<RwTexture***>( 0x590CCE + 2, Memory::PatternAndOffset("8D 49 00 83 3E 00 74 07 8B CE E8", 18 + 2) );
|
||||
return std::distance( begin, end );
|
||||
} () - 1;
|
||||
|
||||
|
@ -1107,9 +1109,9 @@ static CVector curVecToSun;
|
|||
static void (*orgSetLightsWithTimeOfDayColour)( RpWorld* );
|
||||
static void SetLightsWithTimeOfDayColour_SilentPatch( RpWorld* world )
|
||||
{
|
||||
static CVector* const VectorToSun = *AddressByVersion<CVector**>( 0x6FC5B7 + 3, 0, 0 ); // TODO: DO
|
||||
static int& CurrentStoredValue = **AddressByVersion<int**>( 0x6FC632 + 1, 0, 0 ); // TODO: DO
|
||||
static CVector& vecDirnLightToSun = **AddressByVersion<CVector**>( 0x5BC040 + 2, 0, 0 ); // TODO: Do
|
||||
static CVector* const VectorToSun = *AddressByVersion<CVector**>( 0x6FC5B7 + 3, Memory::PatternAndOffset("DC 0D ? ? ? ? 8D 04 40 8B 0C 85", 9 + 3) );
|
||||
static int& CurrentStoredValue = **AddressByVersion<int**>( 0x6FC632 + 1, Memory::PatternAndOffset("84 C0 0F 84 AB 01 00 00 A1", 8 + 1) );
|
||||
static CVector& vecDirnLightToSun = **AddressByVersion<CVector**>( 0x5BC040 + 2, Memory::PatternAndOffset("E8 ? ? ? ? D9 5D F8 D9 45 F8 D8 4D F4 D9 1D", 15 + 2) );
|
||||
|
||||
curVecToSun = bUseAaronSun ? VectorToSun[CurrentStoredValue] : vecDirnLightToSun;
|
||||
orgSetLightsWithTimeOfDayColour( world );
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
#include "TimerSA.h"
|
||||
|
||||
int& CTimer::m_snTimeInMilliseconds = **AddressByVersion<int**>(0x4242D1, 0x53F6A1, 0x406FA1);
|
||||
float& CTimer::m_fTimeStep = **AddressByVersion<float**>(0x41DE4F + 2, 0, 0);
|
||||
float& CTimer::m_fTimeStep = **AddressByVersion<float**>(0x41DE4F + 2, Memory::PatternAndOffset("0F B7 86 DC 04 00 00 D9 05", 8) );
|
Loading…
Reference in a new issue