Skip to content

Commit b4b129c

Browse files
ZReCJusonex
authored andcommitted
Fix 3994: Radio name do not always show. (#129)
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.
1 parent 27c6032 commit b4b129c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Client/game_sa/CVehicleSA.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,8 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA
701701
void SetAdjustablePropertyValue ( unsigned short usAdjustableProperty ) { *reinterpret_cast < unsigned short* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 2156 ) = usAdjustableProperty; };
702702
void SetHeliRotorSpeed ( float fSpeed ) { *reinterpret_cast < float* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 2124 ) = fSpeed; };
703703
void SetExplodeTime ( unsigned long ulTime ) { *reinterpret_cast < unsigned long* > ( reinterpret_cast < unsigned int > ( m_pInterface ) + 1240 ) = ulTime; };
704-
704+
void SetRadioStatus ( bool bStatus ) { *reinterpret_cast < unsigned char* > ( reinterpret_cast < unsigned int > (m_pInterface ) + 0x1D3 ) = bStatus; };
705+
705706
void SetNitroCount ( char cNitroCount ) { GetVehicleInterface ()->m_nNitroBoosts = cNitroCount; }
706707
void SetNitroLevel ( float fLevel );
707708

Client/mods/deathmatch/logic/CClientVehicle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,6 +2739,7 @@ void CClientVehicle::Create ( void )
27392739
m_pVehicle->SetSmokeTrailEnabled ( m_bSmokeTrail );
27402740
m_pVehicle->SetGravity ( &m_vecGravity );
27412741
m_pVehicle->SetHeadLightColor ( m_HeadLightColor );
2742+
m_pVehicle->SetRadioStatus ( 0 );
27422743

27432744
if ( IsNitroInstalled() )
27442745
{

Client/sdk/game/CVehicle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class CVehicle : public virtual CPhysical
225225
virtual void SetHeliRotorSpeed ( float fSpeed ) = 0;
226226
virtual void SetTaxiLightOn ( bool bLightState ) = 0;
227227
virtual void SetExplodeTime ( unsigned long ulTime ) = 0;
228+
virtual void SetRadioStatus ( bool bStatus ) = 0;
228229

229230
virtual void SetNitroCount ( char cNitroCount ) = 0;
230231
virtual void SetNitroLevel ( float fNitroLevel ) = 0;

0 commit comments

Comments
 (0)