From 13dd0065371365875a579430b99ab5363569f51a Mon Sep 17 00:00:00 2001 From: ZReC Date: Sat, 6 May 2017 02:56:10 -0300 Subject: [PATCH] Fix 3994: Radio name do not always show. This happens with gta sa vehicles that have by default the radio disabled. I think I have found a way to change this without altering the CAudioEngine::IsVehicleRadioActive function. --- Client/game_sa/CVehicleSA.h | 3 ++- Client/mods/deathmatch/logic/CClientVehicle.cpp | 1 + Client/sdk/game/CVehicle.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/game_sa/CVehicleSA.h b/Client/game_sa/CVehicleSA.h index de15aebf8f0..ee17b44c27e 100644 --- a/Client/game_sa/CVehicleSA.h +++ b/Client/game_sa/CVehicleSA.h @@ -701,7 +701,8 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA void SetAdjustablePropertyValue ( unsigned short usAdjustableProperty ) { *reinterpret_cast < unsigned short* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 2156 ) = usAdjustableProperty; }; void SetHeliRotorSpeed ( float fSpeed ) { *reinterpret_cast < float* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 2124 ) = fSpeed; }; void SetExplodeTime ( unsigned long ulTime ) { *reinterpret_cast < unsigned long* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 1240 ) = ulTime; }; - + void SetRadioStatus ( bool bStatus ) { *reinterpret_cast < unsigned char* > ( reinterpret_cast < unsigned int > (m_pInterface ) + 0x1D3 ) = bStatus; }; + void SetNitroCount ( char cNitroCount ) { GetVehicleInterface ()->m_nNitroBoosts = cNitroCount; } void SetNitroLevel ( float fLevel ); diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index ee6eb936a4c..8c2d4b67d76 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -2739,6 +2739,7 @@ void CClientVehicle::Create ( void ) m_pVehicle->SetSmokeTrailEnabled ( m_bSmokeTrail ); m_pVehicle->SetGravity ( &m_vecGravity ); m_pVehicle->SetHeadLightColor ( m_HeadLightColor ); + m_pVehicle->SetRadioStatus ( 0 ); if ( IsNitroInstalled() ) { diff --git a/Client/sdk/game/CVehicle.h b/Client/sdk/game/CVehicle.h index f21b11fe7cf..0c8558b3d2d 100644 --- a/Client/sdk/game/CVehicle.h +++ b/Client/sdk/game/CVehicle.h @@ -225,6 +225,7 @@ class CVehicle : public virtual CPhysical virtual void SetHeliRotorSpeed ( float fSpeed ) = 0; virtual void SetTaxiLightOn ( bool bLightState ) = 0; virtual void SetExplodeTime ( unsigned long ulTime ) = 0; + virtual void SetRadioStatus ( bool bStatus ) = 0; virtual void SetNitroCount ( char cNitroCount ) = 0; virtual void SetNitroLevel ( float fNitroLevel ) = 0;