From 33fd901c55ca4f425f8789f5b554d1a9636951b4 Mon Sep 17 00:00:00 2001 From: ZReC Date: Fri, 24 Mar 2017 02:42:33 -0300 Subject: [PATCH 1/3] is/setRandomFoliageEnabled (Client function) Enable/Disable random foliage generation. BEFORE: https://drive.google.com/open?id=0BxjQi6_IK2doWjJEaWY3Sm42QW8 AFTER: https://drive.google.com/open?id=0BxjQi6_IK2doY2xFRzh5aGpXZTA --- Client/mods/deathmatch/logic/CClientGame.cpp | 3 ++ .../logic/lua/CLuaFunctionDefs.World.cpp | 29 +++++++++++++++++++ .../deathmatch/logic/lua/CLuaFunctionDefs.h | 2 ++ .../mods/deathmatch/logic/lua/CLuaManager.cpp | 2 ++ Client/multiplayer_sa/CMultiplayerSA.cpp | 13 +++++++++ Client/multiplayer_sa/CMultiplayerSA.h | 2 ++ Client/sdk/multiplayer/CMultiplayer.h | 2 ++ .../deathmatch/logic/CResourceChecker.Data.h | 2 ++ 8 files changed, 55 insertions(+) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index ce62592ff73..dc4a6e16004 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -5523,6 +5523,9 @@ void CClientGame::ResetMapInfo ( void ) for ( int i = 0; i <= 4; ++i ) g_pMultiplayer->SetInteriorFurnitureEnabled ( i, true ); + // Re-enable random foliage + g_pMultiplayer->SetRandomFoliageEnabled ( true ); + // Clouds g_pMultiplayer->SetCloudsEnabled ( true ); g_pClientGame->SetCloudsEnabled ( true ); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp index 3d3d93fb7fc..82cae464003 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp @@ -1406,6 +1406,35 @@ int CLuaFunctionDefs::SetInteriorFurnitureEnabled ( lua_State* luaVM ) return 1; } +int CLuaFunctionDefs::IsRandomFoliageEnabled ( lua_State* luaVM ) +{ +// bool isRandomFoliageEnabled () + + lua_pushboolean ( luaVM, g_pMultiplayer->IsRandomFoliageEnabled () ); + return 1; +} + +int CLuaFunctionDefs::SetRandomFoliageEnabled ( lua_State* luaVM ) +{ +// bool setRandomFoliageEnabled ( bool enabled ) + + bool bEnabled; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadBool ( bEnabled ); + + if ( !argStream.HasErrors () ) + { + g_pMultiplayer->SetRandomFoliageEnabled ( bEnabled ); + + lua_pushboolean ( luaVM, true ); + return 1; + } + + lua_pushboolean ( luaVM, false ); + return 1; +} + int CLuaFunctionDefs::GetRainLevel ( lua_State* luaVM ) { lua_pushnumber ( luaVM, g_pGame->GetWeather ()->GetAmountOfRain ()); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h index 5006ae90cf5..366061fd431 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h @@ -153,6 +153,8 @@ class CLuaFunctionDefs LUA_DECLARE ( SetInteriorSoundsEnabled ); LUA_DECLARE ( GetInteriorFurnitureEnabled ); LUA_DECLARE ( SetInteriorFurnitureEnabled ); + LUA_DECLARE ( IsRandomFoliageEnabled ); + LUA_DECLARE ( SetRandomFoliageEnabled ); LUA_DECLARE ( GetRainLevel ); LUA_DECLARE ( SetRainLevel ); LUA_DECLARE ( ResetRainLevel ); diff --git a/Client/mods/deathmatch/logic/lua/CLuaManager.cpp b/Client/mods/deathmatch/logic/lua/CLuaManager.cpp index 8422bf8ef80..3c653f2fb3a 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaManager.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaManager.cpp @@ -296,6 +296,7 @@ void CLuaManager::LoadCFunctions ( void ) CLuaCFunctions::AddFunction ( "getJetpackMaxHeight", CLuaFunctionDefs::GetJetpackMaxHeight ); CLuaCFunctions::AddFunction ( "getWindVelocity", CLuaFunctionDefs::GetWindVelocity ); CLuaCFunctions::AddFunction ( "getInteriorSoundsEnabled", CLuaFunctionDefs::GetInteriorSoundsEnabled ); + CLuaCFunctions::AddFunction ( "isRandomFoliageEnabled", CLuaFunctionDefs::IsRandomFoliageEnabled ); CLuaCFunctions::AddFunction ( "getInteriorFurnitureEnabled", CLuaFunctionDefs::GetInteriorFurnitureEnabled ); CLuaCFunctions::AddFunction ( "getFarClipDistance", CLuaFunctionDefs::GetFarClipDistance ); CLuaCFunctions::AddFunction ( "getNearClipDistance", CLuaFunctionDefs::GetNearClipDistance ); @@ -338,6 +339,7 @@ void CLuaManager::LoadCFunctions ( void ) CLuaCFunctions::AddFunction ( "resetWindVelocity", CLuaFunctionDefs::ResetWindVelocity ); CLuaCFunctions::AddFunction ( "setInteriorSoundsEnabled", CLuaFunctionDefs::SetInteriorSoundsEnabled ); CLuaCFunctions::AddFunction ( "setInteriorFurnitureEnabled", CLuaFunctionDefs::SetInteriorFurnitureEnabled ); + CLuaCFunctions::AddFunction ( "setRandomFoliageEnabled", CLuaFunctionDefs::SetRandomFoliageEnabled ); CLuaCFunctions::AddFunction ( "setRainLevel", CLuaFunctionDefs::SetRainLevel ); CLuaCFunctions::AddFunction ( "resetRainLevel", CLuaFunctionDefs::ResetRainLevel ); CLuaCFunctions::AddFunction ( "setFarClipDistance", CLuaFunctionDefs::SetFarClipDistance ); diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 75f8e3cff7d..6608d037c36 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -1752,6 +1752,19 @@ void CMultiplayerSA::SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ) bInteriorFurnitureStates[cRoomId] = bEnabled; } +bool CMultiplayerSA::IsRandomFoliageEnabled () +{ + return *(unsigned char *)0x5DD01B == 0x74; +} + +void CMultiplayerSA::SetRandomFoliageEnabled ( bool bEnabled ) +{ + // 0xEB skip random foliage generation + MemPut < BYTE > ( 0x5DD01B, bEnabled ? 0x74 : 0xEB) ; + // 0x74 destroy random foliage loaded + MemPut < BYTE > ( 0x5DC536, bEnabled ? 0x75 : 0x74 ); +} + void CMultiplayerSA::SetWindVelocity ( float fX, float fY, float fZ ) { //Disable diff --git a/Client/multiplayer_sa/CMultiplayerSA.h b/Client/multiplayer_sa/CMultiplayerSA.h index ef5baae67e6..d496070ad33 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.h +++ b/Client/multiplayer_sa/CMultiplayerSA.h @@ -150,6 +150,8 @@ class CMultiplayerSA : public CMultiplayer void SetInteriorSoundsEnabled ( bool bEnabled ); bool GetInteriorFurnitureEnabled ( char cRoomId ); void SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ); + bool IsRandomFoliageEnabled (); + void SetRandomFoliageEnabled ( bool bEnabled ); void SetWindVelocity ( float fX, float fY, float fZ ); void GetWindVelocity ( float& fX, float& fY, float& fZ ); void RestoreWindVelocity ( void ); diff --git a/Client/sdk/multiplayer/CMultiplayer.h b/Client/sdk/multiplayer/CMultiplayer.h index 23cca99d1db..91aec4d59db 100644 --- a/Client/sdk/multiplayer/CMultiplayer.h +++ b/Client/sdk/multiplayer/CMultiplayer.h @@ -214,6 +214,8 @@ class CMultiplayer virtual void SetInteriorSoundsEnabled ( bool bEnabled ) = 0; virtual bool GetInteriorFurnitureEnabled ( char cRoomId ) = 0; virtual void SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ) = 0; + virtual bool IsRandomFoliageEnabled () = 0; + virtual void SetRandomFoliageEnabled ( bool bEnabled ) = 0; virtual void SetWindVelocity ( float fX, float fY, float fZ ) = 0; virtual void GetWindVelocity ( float& fX, float& fY, float& fZ ) = 0; virtual void RestoreWindVelocity ( void ) = 0; diff --git a/Server/mods/deathmatch/logic/CResourceChecker.Data.h b/Server/mods/deathmatch/logic/CResourceChecker.Data.h index e1b4be01e43..a7d3bfb80c1 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.Data.h +++ b/Server/mods/deathmatch/logic/CResourceChecker.Data.h @@ -164,6 +164,8 @@ namespace { "pregMatch", "1.3.5" }, { "setInteriorFurnitureEnabled", "1.3.5-9.06101" }, { "getInteriorFurnitureEnabled", "1.3.5-9.06101" }, + { "setRandomFoliageEnabled", "1.5.4" }, + { "isRandomFoliageEnabled", "1.5.4" }, { "setElementCallPropagationEnabled", "1.3.5-9.06118" }, { "isElementCallPropagationEnabled", "1.3.5-9.06118" }, { "getResourceState", "1.3.5-9.06194" }, From 69deba3d3dd409a73bc92f4c44d4b6d4a8ffe511 Mon Sep 17 00:00:00 2001 From: ZReC Date: Fri, 24 Mar 2017 09:06:13 -0300 Subject: [PATCH 2/3] Revert "is/setRandomFoliageEnabled (Client function)" This reverts commit 33fd901c55ca4f425f8789f5b554d1a9636951b4. --- Client/mods/deathmatch/logic/CClientGame.cpp | 3 -- .../logic/lua/CLuaFunctionDefs.World.cpp | 29 ------------------- .../deathmatch/logic/lua/CLuaFunctionDefs.h | 2 -- .../mods/deathmatch/logic/lua/CLuaManager.cpp | 2 -- Client/multiplayer_sa/CMultiplayerSA.cpp | 13 --------- Client/multiplayer_sa/CMultiplayerSA.h | 2 -- Client/sdk/multiplayer/CMultiplayer.h | 2 -- .../deathmatch/logic/CResourceChecker.Data.h | 2 -- 8 files changed, 55 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index dc4a6e16004..ce62592ff73 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -5523,9 +5523,6 @@ void CClientGame::ResetMapInfo ( void ) for ( int i = 0; i <= 4; ++i ) g_pMultiplayer->SetInteriorFurnitureEnabled ( i, true ); - // Re-enable random foliage - g_pMultiplayer->SetRandomFoliageEnabled ( true ); - // Clouds g_pMultiplayer->SetCloudsEnabled ( true ); g_pClientGame->SetCloudsEnabled ( true ); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp index 82cae464003..3d3d93fb7fc 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.World.cpp @@ -1406,35 +1406,6 @@ int CLuaFunctionDefs::SetInteriorFurnitureEnabled ( lua_State* luaVM ) return 1; } -int CLuaFunctionDefs::IsRandomFoliageEnabled ( lua_State* luaVM ) -{ -// bool isRandomFoliageEnabled () - - lua_pushboolean ( luaVM, g_pMultiplayer->IsRandomFoliageEnabled () ); - return 1; -} - -int CLuaFunctionDefs::SetRandomFoliageEnabled ( lua_State* luaVM ) -{ -// bool setRandomFoliageEnabled ( bool enabled ) - - bool bEnabled; - - CScriptArgReader argStream ( luaVM ); - argStream.ReadBool ( bEnabled ); - - if ( !argStream.HasErrors () ) - { - g_pMultiplayer->SetRandomFoliageEnabled ( bEnabled ); - - lua_pushboolean ( luaVM, true ); - return 1; - } - - lua_pushboolean ( luaVM, false ); - return 1; -} - int CLuaFunctionDefs::GetRainLevel ( lua_State* luaVM ) { lua_pushnumber ( luaVM, g_pGame->GetWeather ()->GetAmountOfRain ()); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h index 366061fd431..5006ae90cf5 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.h @@ -153,8 +153,6 @@ class CLuaFunctionDefs LUA_DECLARE ( SetInteriorSoundsEnabled ); LUA_DECLARE ( GetInteriorFurnitureEnabled ); LUA_DECLARE ( SetInteriorFurnitureEnabled ); - LUA_DECLARE ( IsRandomFoliageEnabled ); - LUA_DECLARE ( SetRandomFoliageEnabled ); LUA_DECLARE ( GetRainLevel ); LUA_DECLARE ( SetRainLevel ); LUA_DECLARE ( ResetRainLevel ); diff --git a/Client/mods/deathmatch/logic/lua/CLuaManager.cpp b/Client/mods/deathmatch/logic/lua/CLuaManager.cpp index 3c653f2fb3a..8422bf8ef80 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaManager.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaManager.cpp @@ -296,7 +296,6 @@ void CLuaManager::LoadCFunctions ( void ) CLuaCFunctions::AddFunction ( "getJetpackMaxHeight", CLuaFunctionDefs::GetJetpackMaxHeight ); CLuaCFunctions::AddFunction ( "getWindVelocity", CLuaFunctionDefs::GetWindVelocity ); CLuaCFunctions::AddFunction ( "getInteriorSoundsEnabled", CLuaFunctionDefs::GetInteriorSoundsEnabled ); - CLuaCFunctions::AddFunction ( "isRandomFoliageEnabled", CLuaFunctionDefs::IsRandomFoliageEnabled ); CLuaCFunctions::AddFunction ( "getInteriorFurnitureEnabled", CLuaFunctionDefs::GetInteriorFurnitureEnabled ); CLuaCFunctions::AddFunction ( "getFarClipDistance", CLuaFunctionDefs::GetFarClipDistance ); CLuaCFunctions::AddFunction ( "getNearClipDistance", CLuaFunctionDefs::GetNearClipDistance ); @@ -339,7 +338,6 @@ void CLuaManager::LoadCFunctions ( void ) CLuaCFunctions::AddFunction ( "resetWindVelocity", CLuaFunctionDefs::ResetWindVelocity ); CLuaCFunctions::AddFunction ( "setInteriorSoundsEnabled", CLuaFunctionDefs::SetInteriorSoundsEnabled ); CLuaCFunctions::AddFunction ( "setInteriorFurnitureEnabled", CLuaFunctionDefs::SetInteriorFurnitureEnabled ); - CLuaCFunctions::AddFunction ( "setRandomFoliageEnabled", CLuaFunctionDefs::SetRandomFoliageEnabled ); CLuaCFunctions::AddFunction ( "setRainLevel", CLuaFunctionDefs::SetRainLevel ); CLuaCFunctions::AddFunction ( "resetRainLevel", CLuaFunctionDefs::ResetRainLevel ); CLuaCFunctions::AddFunction ( "setFarClipDistance", CLuaFunctionDefs::SetFarClipDistance ); diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 6608d037c36..75f8e3cff7d 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -1752,19 +1752,6 @@ void CMultiplayerSA::SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ) bInteriorFurnitureStates[cRoomId] = bEnabled; } -bool CMultiplayerSA::IsRandomFoliageEnabled () -{ - return *(unsigned char *)0x5DD01B == 0x74; -} - -void CMultiplayerSA::SetRandomFoliageEnabled ( bool bEnabled ) -{ - // 0xEB skip random foliage generation - MemPut < BYTE > ( 0x5DD01B, bEnabled ? 0x74 : 0xEB) ; - // 0x74 destroy random foliage loaded - MemPut < BYTE > ( 0x5DC536, bEnabled ? 0x75 : 0x74 ); -} - void CMultiplayerSA::SetWindVelocity ( float fX, float fY, float fZ ) { //Disable diff --git a/Client/multiplayer_sa/CMultiplayerSA.h b/Client/multiplayer_sa/CMultiplayerSA.h index d496070ad33..ef5baae67e6 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.h +++ b/Client/multiplayer_sa/CMultiplayerSA.h @@ -150,8 +150,6 @@ class CMultiplayerSA : public CMultiplayer void SetInteriorSoundsEnabled ( bool bEnabled ); bool GetInteriorFurnitureEnabled ( char cRoomId ); void SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ); - bool IsRandomFoliageEnabled (); - void SetRandomFoliageEnabled ( bool bEnabled ); void SetWindVelocity ( float fX, float fY, float fZ ); void GetWindVelocity ( float& fX, float& fY, float& fZ ); void RestoreWindVelocity ( void ); diff --git a/Client/sdk/multiplayer/CMultiplayer.h b/Client/sdk/multiplayer/CMultiplayer.h index 91aec4d59db..23cca99d1db 100644 --- a/Client/sdk/multiplayer/CMultiplayer.h +++ b/Client/sdk/multiplayer/CMultiplayer.h @@ -214,8 +214,6 @@ class CMultiplayer virtual void SetInteriorSoundsEnabled ( bool bEnabled ) = 0; virtual bool GetInteriorFurnitureEnabled ( char cRoomId ) = 0; virtual void SetInteriorFurnitureEnabled ( char cRoomId, bool bEnabled ) = 0; - virtual bool IsRandomFoliageEnabled () = 0; - virtual void SetRandomFoliageEnabled ( bool bEnabled ) = 0; virtual void SetWindVelocity ( float fX, float fY, float fZ ) = 0; virtual void GetWindVelocity ( float& fX, float& fY, float& fZ ) = 0; virtual void RestoreWindVelocity ( void ) = 0; diff --git a/Server/mods/deathmatch/logic/CResourceChecker.Data.h b/Server/mods/deathmatch/logic/CResourceChecker.Data.h index a7d3bfb80c1..e1b4be01e43 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.Data.h +++ b/Server/mods/deathmatch/logic/CResourceChecker.Data.h @@ -164,8 +164,6 @@ namespace { "pregMatch", "1.3.5" }, { "setInteriorFurnitureEnabled", "1.3.5-9.06101" }, { "getInteriorFurnitureEnabled", "1.3.5-9.06101" }, - { "setRandomFoliageEnabled", "1.5.4" }, - { "isRandomFoliageEnabled", "1.5.4" }, { "setElementCallPropagationEnabled", "1.3.5-9.06118" }, { "isElementCallPropagationEnabled", "1.3.5-9.06118" }, { "getResourceState", "1.3.5-9.06194" }, From bf52709e9cea0d7ee5933f5526435c0b532c9582 Mon Sep 17 00:00:00 2001 From: ZReC Date: Fri, 24 Mar 2017 09:49:33 -0300 Subject: [PATCH 3/3] Add "randomfoliage" special property --- Client/game_sa/CGameSA.cpp | 24 ++++++++++++++++++++++++ Client/game_sa/CGameSA.h | 5 +++++ Client/sdk/game/CGame.h | 3 +++ 3 files changed, 32 insertions(+) diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index 6b2d752e0d8..94164f20adc 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -569,6 +569,9 @@ void CGameSA::SetMinuteDuration ( unsigned long ulTime ) bool CGameSA::IsCheatEnabled ( const char* szCheatName ) { + if (!strcmp ( szCheatName, PROP_RANDOM_FOLIAGE )) + return IsRandomFoliageEnabled (); + std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName ); if ( it == m_Cheats.end () ) return false; @@ -577,6 +580,12 @@ bool CGameSA::IsCheatEnabled ( const char* szCheatName ) bool CGameSA::SetCheatEnabled ( const char* szCheatName, bool bEnable ) { + if (!strcmp ( szCheatName, PROP_RANDOM_FOLIAGE )) + { + SetRandomFoliageEnabled ( bEnable ); + return true; + } + std::map < std::string, SCheatSA* >::iterator it = m_Cheats.find ( szCheatName ); if ( it == m_Cheats.end () ) return false; @@ -589,6 +598,8 @@ bool CGameSA::SetCheatEnabled ( const char* szCheatName, bool bEnable ) void CGameSA::ResetCheats () { + SetRandomFoliageEnabled ( true ); + std::map < std::string, SCheatSA* >::iterator it; for ( it = m_Cheats.begin (); it != m_Cheats.end (); it++ ) { if ( it->second->m_byAddress > (BYTE*)0x8A4000 ) @@ -599,6 +610,19 @@ void CGameSA::ResetCheats () } } +bool CGameSA::IsRandomFoliageEnabled () +{ + return *(unsigned char *)0x5DD01B == 0x74; +} + +void CGameSA::SetRandomFoliageEnabled ( bool bEnabled ) +{ + // 0xEB skip random foliage generation + MemPut < BYTE > ( 0x5DD01B, bEnabled ? 0x74 : 0xEB ); + // 0x74 destroy random foliage loaded + MemPut < BYTE > ( 0x5DC536, bEnabled ? 0x75 : 0x74 ); +} + bool CGameSA::GetJetpackWeaponEnabled ( eWeaponType weaponType ) { if ( weaponType >= WEAPONTYPE_BRASSKNUCKLE && weaponType < WEAPONTYPE_LAST_WEAPONTYPE ) diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index eebad52ee42..b2f5603f890 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -87,6 +87,8 @@ #define CHEAT_NEVERWANTED "neverwanted" #define CHEAT_HEALTARMORMONEY "healtharmormoney" +#define PROP_RANDOM_FOLIAGE "randomfoliage" + struct SCheatSA { BYTE* m_byAddress; //Cheat Address bool m_bEnabled; //Cheat State @@ -213,6 +215,9 @@ class CGameSA : public CGame bool SetCheatEnabled ( const char* szCheatName, bool bEnable ); void ResetCheats (); + bool IsRandomFoliageEnabled (); + void SetRandomFoliageEnabled ( bool bEnable ); + bool VerifySADataFileNames (); bool PerformChecks (); int& GetCheckStatus ( void ) { return m_iCheckStatus; } diff --git a/Client/sdk/game/CGame.h b/Client/sdk/game/CGame.h index 8d50d3b89e4..e631c158e57 100644 --- a/Client/sdk/game/CGame.h +++ b/Client/sdk/game/CGame.h @@ -209,6 +209,9 @@ class __declspec(novtable) CGame virtual bool IsCheatEnabled ( const char* szCheatName ) = 0; virtual bool SetCheatEnabled ( const char* szCheatName, bool bEnable ) = 0; virtual void ResetCheats () = 0; + + virtual bool IsRandomFoliageEnabled () = 0; + virtual void SetRandomFoliageEnabled ( bool bEnable ) = 0; virtual CWeapon * CreateWeapon ( void ) = 0; virtual CWeaponStat * CreateWeaponStat ( eWeaponType weaponType, eWeaponSkill weaponSkill ) = 0;