Skip to content

Commit ba64500

Browse files
committed
Added world special property "extraairresitance" to remove speed limiter on certain road sections. https://bugs.mtasa.com/view.php?id=7546
1 parent 16c8ac5 commit ba64500

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Client/game_sa/CGameSA.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ bool CGameSA::IsCheatEnabled ( const char* szCheatName )
575575
if ( !strcmp ( szCheatName, PROP_SNIPER_MOON ) )
576576
return IsMoonEasterEggEnabled ();
577577

578+
if ( !strcmp ( szCheatName, PROP_EXTRA_AIR_RESISTANCE ) )
579+
return IsExtraAirResistanceEnabled ();
580+
578581
std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName );
579582
if ( it == m_Cheats.end () )
580583
return false;
@@ -594,6 +597,12 @@ bool CGameSA::SetCheatEnabled ( const char* szCheatName, bool bEnable )
594597
SetMoonEasterEggEnabled ( bEnable );
595598
return true;
596599
}
600+
601+
if ( !strcmp( szCheatName, PROP_EXTRA_AIR_RESISTANCE ) )
602+
{
603+
SetExtraAirResistanceEnabled ( bEnable );
604+
return true;
605+
}
597606

598607
std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName );
599608
if ( it == m_Cheats.end () )
@@ -608,8 +617,8 @@ bool CGameSA::SetCheatEnabled ( const char* szCheatName, bool bEnable )
608617
void CGameSA::ResetCheats ()
609618
{
610619
SetRandomFoliageEnabled ( true );
611-
612620
SetMoonEasterEggEnabled ( false );
621+
SetExtraAirResistanceEnabled ( true );
613622

614623
std::map < std::string, SCheatSA* >::iterator it;
615624
for ( it = m_Cheats.begin (); it != m_Cheats.end (); it++ ) {
@@ -645,6 +654,16 @@ void CGameSA::SetMoonEasterEggEnabled ( bool bEnable )
645654
MemPut < BYTE > ( 0x73ABCF, bEnable ? 0x75 : 0xEB );
646655
}
647656

657+
bool CGameSA::IsExtraAirResistanceEnabled ()
658+
{
659+
return *(unsigned char *)0x72DDD9 == 0x01;
660+
}
661+
662+
void CGameSA::SetExtraAirResistanceEnabled ( bool bEnable )
663+
{
664+
MemPut < BYTE > ( 0x72DDD9, bEnable ? 0x01 : 0x00 );
665+
}
666+
648667
bool CGameSA::GetJetpackWeaponEnabled ( eWeaponType weaponType )
649668
{
650669
if ( weaponType >= WEAPONTYPE_BRASSKNUCKLE && weaponType < WEAPONTYPE_LAST_WEAPONTYPE )

Client/game_sa/CGameSA.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
#define PROP_RANDOM_FOLIAGE "randomfoliage"
9191
#define PROP_SNIPER_MOON "snipermoon"
92+
#define PROP_EXTRA_AIR_RESISTANCE "extraairresistance"
9293

9394
struct SCheatSA {
9495
BYTE* m_byAddress; //Cheat Address
@@ -222,6 +223,9 @@ class CGameSA : public CGame
222223
bool IsMoonEasterEggEnabled ();
223224
void SetMoonEasterEggEnabled ( bool bEnabled );
224225

226+
bool IsExtraAirResistanceEnabled ();
227+
void SetExtraAirResistanceEnabled ( bool bEnable );
228+
225229
bool VerifySADataFileNames ();
226230
bool PerformChecks ();
227231
int& GetCheckStatus ( void ) { return m_iCheckStatus; }

0 commit comments

Comments
 (0)