Skip to content
Permalink
Browse files

Add "traincinemacamera" special property

Cinematic camera for the trains
  • Loading branch information...
ZReC committed May 1, 2017
1 parent cc48fb6 commit 795b993314cacafb0e6aac2563d607e0838c5361
Showing with 30 additions and 6 deletions.
  1. +23 −3 Client/game_sa/CGameSA.cpp
  2. +5 −1 Client/game_sa/CGameSA.h
  3. +2 −2 Client/multiplayer_sa/CMultiplayerSA.cpp
@@ -578,6 +578,9 @@ bool CGameSA::IsCheatEnabled ( const char* szCheatName )
if ( !strcmp ( szCheatName, PROP_EXTRA_AIR_RESISTANCE ) )
return IsExtraAirResistanceEnabled ();

if (!strcmp ( szCheatName, PROP_TRAIN_CINEMA_CAMERA ))
return IsTrainCinematicCameraEnabled ();

std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName );
if ( it == m_Cheats.end () )
return false;
@@ -604,6 +607,12 @@ bool CGameSA::SetCheatEnabled ( const char* szCheatName, bool bEnable )
return true;
}

if (!strcmp ( szCheatName, PROP_TRAIN_CINEMA_CAMERA ))
{
SetTrainCinematicCameraEnabled ( bEnable );
return true;
}

std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName );
if ( it == m_Cheats.end () )
return false;
@@ -619,6 +628,7 @@ void CGameSA::ResetCheats ()
SetRandomFoliageEnabled ( true );
SetMoonEasterEggEnabled ( false );
SetExtraAirResistanceEnabled ( true );
SetTrainCinematicCameraEnabled ( false );

std::map < std::string, SCheatSA* >::iterator it;
for ( it = m_Cheats.begin (); it != m_Cheats.end (); it++ ) {
@@ -635,12 +645,12 @@ bool CGameSA::IsRandomFoliageEnabled ()
return *(unsigned char *)0x5DD01B == 0x74;
}

void CGameSA::SetRandomFoliageEnabled ( bool bEnabled )
void CGameSA::SetRandomFoliageEnabled ( bool bEnable )
{
// 0xEB skip random foliage generation
MemPut < BYTE > ( 0x5DD01B, bEnabled ? 0x74 : 0xEB );
MemPut < BYTE > ( 0x5DD01B, bEnable ? 0x74 : 0xEB );
// 0x74 destroy random foliage loaded
MemPut < BYTE > ( 0x5DC536, bEnabled ? 0x75 : 0x74 );
MemPut < BYTE > ( 0x5DC536, bEnable ? 0x75 : 0x74 );
}

bool CGameSA::IsMoonEasterEggEnabled ()
@@ -664,6 +674,16 @@ void CGameSA::SetExtraAirResistanceEnabled ( bool bEnable )
MemPut < BYTE > ( 0x72DDD9, bEnable ? 0x01 : 0x00 );
}

bool CGameSA::IsTrainCinematicCameraEnabled ()
{
return *(unsigned char *)0x52A535 == 0x01;
}

void CGameSA::SetTrainCinematicCameraEnabled ( bool bEnable )
{
MemPut < BYTE > ( 0x52A535, bEnable ? 0x01 : 0x00 );
}

bool CGameSA::GetJetpackWeaponEnabled ( eWeaponType weaponType )
{
if ( weaponType >= WEAPONTYPE_BRASSKNUCKLE && weaponType < WEAPONTYPE_LAST_WEAPONTYPE )
@@ -90,6 +90,7 @@
#define PROP_RANDOM_FOLIAGE "randomfoliage"
#define PROP_SNIPER_MOON "snipermoon"
#define PROP_EXTRA_AIR_RESISTANCE "extraairresistance"
#define PROP_TRAIN_CINEMA_CAMERA "traincinemacamera"

struct SCheatSA {
BYTE* m_byAddress; //Cheat Address
@@ -221,11 +222,14 @@ class CGameSA : public CGame
void SetRandomFoliageEnabled ( bool bEnable );

bool IsMoonEasterEggEnabled ();
void SetMoonEasterEggEnabled ( bool bEnabled );
void SetMoonEasterEggEnabled ( bool bEnable );

bool IsExtraAirResistanceEnabled ();
void SetExtraAirResistanceEnabled ( bool bEnable );

bool IsTrainCinematicCameraEnabled ();
void SetTrainCinematicCameraEnabled ( bool bEnable );

bool VerifySADataFileNames ();
bool PerformChecks ();
int& GetCheckStatus ( void ) { return m_iCheckStatus; }
@@ -739,8 +739,8 @@ void CMultiplayerSA::InitHooks()
MemPut < BYTE > ( 0x4EB3C1, 0x10 );
MemPut < BYTE > ( 0x4EB3C2, 0x00 );

// DISABLE cinematic camera for trains
MemPut < BYTE > ( 0x52A535, 0 );
/* DISABLE cinematic camera for trains
MemPut < BYTE > ( 0x52A535, 0 );*/

// DISABLE wanted levels for military zones
MemPut < BYTE > ( 0x72DF0D, 0xEB );

0 comments on commit 795b993

Please sign in to comment.
You can’t perform that action at this time.