Removed nasty ReadCall hacks

This commit is contained in:
Silent 2018-04-22 00:18:12 +02:00
parent 33c1ab4ace
commit 16a8b15086
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
2 changed files with 5 additions and 14 deletions

View File

@ -15,9 +15,7 @@ namespace Common {
{
auto addr = get_pattern( "83 3C 33 00 74 19 89 F9 E8", 8 );
void* pRestoreCar;
ReadCall( addr, pRestoreCar );
CStoredCar::orgRestoreCar = *(decltype(CStoredCar::orgRestoreCar)*)&pRestoreCar;
ReadCall( addr, CStoredCar::orgRestoreCar );
InjectHook( addr, &CStoredCar::RestoreCar_SilentPatch );
}
}

View File

@ -3514,9 +3514,7 @@ void Patch_SA_10()
// Fixed bomb ownership/bombs saving for bikes
{
void* pRestoreCar;
ReadCall( 0x44856A, pRestoreCar );
CStoredCar::orgRestoreCar = *(decltype(CStoredCar::orgRestoreCar)*)&pRestoreCar;
ReadCall( 0x44856A, CStoredCar::orgRestoreCar );
InjectHook( 0x44856A, &CStoredCar::RestoreCar_SilentPatch );
InjectHook( 0x4485DB, &CStoredCar::RestoreCar_SilentPatch );
}
@ -3550,9 +3548,7 @@ void Patch_SA_10()
// Fixed ammo from SCM
{
void* pGiveWeapon;
ReadCall( 0x47D335, pGiveWeapon );
CPed::orgGiveWeapon = *(decltype(CPed::orgGiveWeapon)*)&pGiveWeapon;
ReadCall( 0x47D335, CPed::orgGiveWeapon );
InjectHook( 0x47D335, &CPed::GiveWeapon_SP );
}
@ -3565,13 +3561,10 @@ void Patch_SA_10()
InjectHook( 0x53A986, GetVehicleDriver );
InjectHook( 0x53A9A9, GetVehicleDriver );
void* func;
ReadCall( 0x53A990, func );
CPlayerPed::orgDoStuffToGoOnFire = *(decltype(CPlayerPed::orgDoStuffToGoOnFire)*)&func;
ReadCall( 0x53A990, CPlayerPed::orgDoStuffToGoOnFire );
InjectHook( 0x53A990, DoStuffToGoOnFire_NullAndPlayerCheck );
ReadCall( 0x53A9B7, func );
CFireManager::orgStartFire = *(decltype(CFireManager::orgStartFire)*)&func;
ReadCall( 0x53A9B7, CFireManager::orgStartFire );
InjectHook( 0x53A9B7, &CFireManager::StartFire_NullEntityCheck );
}