mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-22 13:32:36 +01:00
Fixed ammo granting from SCM - SA 1.0
This commit is contained in:
parent
a4bae15050
commit
1f8b44384e
@ -14,6 +14,8 @@ WRAPPER CTaskSimpleJetPack* CPedIntelligence::GetTaskJetPack() const { VARJMP(va
|
|||||||
static void* varRenderJetPack = AddressByVersion<void*>(0x67F6A0, 0x67FEC0, 0x6AB110);
|
static void* varRenderJetPack = AddressByVersion<void*>(0x67F6A0, 0x67FEC0, 0x6AB110);
|
||||||
WRAPPER void CTaskSimpleJetPack::RenderJetPack(CPed* pPed) { WRAPARG(pPed); VARJMP(varRenderJetPack); }
|
WRAPPER void CTaskSimpleJetPack::RenderJetPack(CPed* pPed) { WRAPARG(pPed); VARJMP(varRenderJetPack); }
|
||||||
|
|
||||||
|
void (CPed::*CPed::orgGiveWeapon)(uint32_t weapon, uint32_t ammo, bool flag);
|
||||||
|
|
||||||
RwObject* GetFirstObject(RwFrame* pFrame)
|
RwObject* GetFirstObject(RwFrame* pFrame)
|
||||||
{
|
{
|
||||||
RwObject* pObject = nullptr;
|
RwObject* pObject = nullptr;
|
||||||
@ -90,4 +92,10 @@ void CPed::RenderForShadow()
|
|||||||
auto* pJetPackTask = pPedIntelligence->GetTaskJetPack();
|
auto* pJetPackTask = pPedIntelligence->GetTaskJetPack();
|
||||||
if ( pJetPackTask )
|
if ( pJetPackTask )
|
||||||
pJetPackTask->RenderJetPack(this);
|
pJetPackTask->RenderJetPack(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPed::GiveWeapon_SP(uint32_t weapon, uint32_t ammo, bool flag)
|
||||||
|
{
|
||||||
|
if ( ammo == 0 ) ammo = 1;
|
||||||
|
(this->*(orgGiveWeapon))( weapon, ammo, flag );
|
||||||
|
}
|
||||||
|
@ -312,6 +312,9 @@ public:
|
|||||||
|
|
||||||
void RenderWeapon(bool bMuzzleFlash, bool bForShadow);
|
void RenderWeapon(bool bMuzzleFlash, bool bForShadow);
|
||||||
void RenderForShadow();
|
void RenderForShadow();
|
||||||
|
|
||||||
|
static void (CPed::*orgGiveWeapon)(uint32_t weapon, uint32_t ammo, bool flag);
|
||||||
|
void GiveWeapon_SP( uint32_t weapon, uint32_t ammo, bool flag );
|
||||||
};
|
};
|
||||||
|
|
||||||
class NOVMT CPlayerPed : public CPed
|
class NOVMT CPlayerPed : public CPed
|
||||||
|
@ -3497,6 +3497,15 @@ void Patch_SA_10()
|
|||||||
// Credits =)
|
// Credits =)
|
||||||
ReadCall( 0x5AF87A, Credits::PrintCreditText );
|
ReadCall( 0x5AF87A, Credits::PrintCreditText );
|
||||||
InjectHook( 0x5AF8A4, Credits::PrintSPCredits );
|
InjectHook( 0x5AF8A4, Credits::PrintSPCredits );
|
||||||
|
|
||||||
|
|
||||||
|
// Fixed ammo from SCM
|
||||||
|
{
|
||||||
|
void* pGiveWeapon;
|
||||||
|
ReadCall( 0x47D335, pGiveWeapon );
|
||||||
|
CPed::orgGiveWeapon = *(decltype(CPed::orgGiveWeapon)*)&pGiveWeapon;
|
||||||
|
InjectHook( 0x47D335, &CPed::GiveWeapon_SP );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Patch_SA_11()
|
void Patch_SA_11()
|
||||||
|
Loading…
Reference in New Issue
Block a user