Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setWaterLevel: add bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel #1402

Merged
merged 15 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions Client/game_sa/CWaterManagerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,17 +742,25 @@ bool CWaterManagerSA::SetPositionWaterLevel(const CVector& vecPosition, float fL
return SetPolyWaterLevel(pPoly, fLevel, pChangeSource);
}

bool CWaterManagerSA::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel)
bool CWaterManagerSA::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel)
{
assert(m_bInitializedVertices);
CVector vecVertexPos;
for (DWORD i = 0; i < NUM_DefWaterVertices; i++)

if (bIncludeWorldSeaLevel || bIncludeWorldNonSeaLevel)
{
m_Vertices[i].GetPosition(vecVertexPos);
if (bIncludeWorldNonSeaLevel || !m_Vertices[i].IsWorldNonSeaLevel())
vecVertexPos.fZ = fLevel;
m_Vertices[i].SetPosition(vecVertexPos, pChangeSource);
for (DWORD i = 0; i < NUM_DefWaterVertices; i++)
{
m_Vertices[i].GetPosition(vecVertexPos);
if ((bIncludeWorldNonSeaLevel && m_Vertices[i].IsWorldNonSeaLevel()) || (bIncludeWorldSeaLevel && !m_Vertices[i].IsWorldNonSeaLevel()))
vecVertexPos.fZ = fLevel;
m_Vertices[i].SetPosition(vecVertexPos, pChangeSource);
}
Comment on lines +752 to +758
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's the type of m_Vertices, but Im pretty sure you could use a for based range loop (eg.: for(auto& vertex : m_Vertices)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NUM_DefWaterVertices is constant value, I think that i will leave this.

}

if (bIncludeOutsideWorldLevel)
SetOutsideWorldWaterLevel(fLevel);

return true;
}

Expand All @@ -768,6 +776,17 @@ bool CWaterManagerSA::SetPolyWaterLevel(CWaterPoly* pPoly, float fLevel, void* p
return true;
}

void CWaterManagerSA::SetOutsideWorldWaterLevel(float fLevel)
{
// Outside world vertices
MemPut<float>(0x6EFECC, fLevel);
MemPut<float>(0x6EFF0C, fLevel);
MemPut<float>(0x6EFF4A, fLevel);
MemPut<float>(0x6EFFA6, fLevel);
// Collision
MemPut<float>(0x6E873F, fLevel);
}

float CWaterManagerSA::GetWaveLevel()
{
return *(float*)VAR_WaveLevel;
Expand Down Expand Up @@ -957,13 +976,17 @@ void CWaterManagerSA::ResetWorldWaterLevel()
if (m_bInitializedVertices)
for (DWORD i = 0; i < NUM_DefWaterVertices; i++)
m_Vertices[i].Reset();

SetOutsideWorldWaterLevel(DEFAULT_WATER_LEVEL);
}

void CWaterManagerSA::Reset()
{
// Resets all water to the original single player configuration
UndoChanges();

SetOutsideWorldWaterLevel(DEFAULT_WATER_LEVEL);

MemSetFast(m_QuadPool, 0, sizeof(m_QuadPool));
MemSetFast(m_TrianglePool, 0, sizeof(m_TrianglePool));

Expand Down
4 changes: 3 additions & 1 deletion Client/game_sa/CWaterManagerSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "CWaterSA.h"

#define DEFAULT_WATER_LEVEL 0.0f
#define DEFAULT_WAVE_LEVEL 0.0f

#define FUNC_ReadWaterConfiguration 0x6EAE80 // ()
Expand Down Expand Up @@ -154,9 +155,10 @@ class CWaterManagerSA : public CWaterManager

bool GetWaterLevel(const CVector& vecPosition, float* pfLevel, bool bCheckWaves, CVector* pvecUnknown);

bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel);
bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel);
bool SetPositionWaterLevel(const CVector& vecPosition, float fLevel, void* pChangeSource);
bool SetPolyWaterLevel(CWaterPoly* pPoly, float fLevel, void* pChangeSource);
void SetOutsideWorldWaterLevel(float fLevel);
void ResetWorldWaterLevel();

float GetWaveLevel();
Expand Down
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/CClientWaterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ bool CClientWaterManager::SetPositionWaterLevel(const CVector& vecPosition, floa
return g_pGame->GetWaterManager()->SetPositionWaterLevel(vecPosition, fLevel, pChangeSource);
}

bool CClientWaterManager::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel)
bool CClientWaterManager::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel)
{
return g_pGame->GetWaterManager()->SetWorldWaterLevel(fLevel, pChangeSource, bIncludeWorldNonSeaLevel);
return g_pGame->GetWaterManager()->SetWorldWaterLevel(fLevel, pChangeSource, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel);
}

bool CClientWaterManager::SetAllElementWaterLevel(float fLevel, void* pChangeSource)
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientWaterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CClientWaterManager

bool GetWaterLevel(CVector& vecPosition, float* pfLevel, bool bCheckWaves, CVector* pvecUnknown);
bool SetPositionWaterLevel(const CVector& vecPosition, float fLevel, void* pChangeSource);
bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel);
bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel);
bool SetAllElementWaterLevel(float fLevel, void* pChangeSource);
void ResetWorldWaterLevel();

Expand Down
20 changes: 17 additions & 3 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2230,18 +2230,32 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream)
float fSeaLevel = 0.0f;
bool bHasNonSeaLevel = false;
float fNonSeaLevel = 0.0f;
bool bHasOutsideLevel = false;
float fOutsideLevel = 0.0f;
bitStream.Read(fSeaLevel);
bitStream.ReadBit(bHasNonSeaLevel);
if (bHasNonSeaLevel)
{
bitStream.Read(fNonSeaLevel);

}
if (bitStream.Can(eBitStreamVersion::SetWaterLevel_ChangeOutsideWorldLevel))
{
bitStream.ReadBit(bHasOutsideLevel);
if (bHasOutsideLevel)
{
bitStream.Read(fOutsideLevel);
}
}
// Reset world water level to GTA default
g_pClientGame->GetManager()->GetWaterManager()->ResetWorldWaterLevel();
// Apply world non-sea level (to all world water)
if (bHasNonSeaLevel)
g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fNonSeaLevel, NULL, true);
g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fNonSeaLevel, nullptr, true, false, false);
// Apply outside world level (before -3000 and after 3000)
if (bHasOutsideLevel)
g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fOutsideLevel, nullptr, false, false, true);
// Apply world sea level (to world sea level water only)
g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fSeaLevel, NULL, false);
g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fSeaLevel, nullptr, false, true, false);

unsigned short usFPSLimit = 36;
bitStream.ReadCompressed(usFPSLimit);
Expand Down
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6308,9 +6308,9 @@ bool CStaticFunctionDefinitions::GetWaterVertexPosition(CClientWater* pWater, in
return pWater->GetVertexPosition(iVertexIndex - 1, vecPosition);
}

bool CStaticFunctionDefinitions::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel)
bool CStaticFunctionDefinitions::SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel)
{
return g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fLevel, pChangeSource, bIncludeWorldNonSeaLevel);
return g_pClientGame->GetManager()->GetWaterManager()->SetWorldWaterLevel(fLevel, pChangeSource, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel);
}

bool CStaticFunctionDefinitions::SetPositionWaterLevel(const CVector& vecPosition, float fLevel, void* pChangeSource)
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ class CStaticFunctionDefinitions
static bool GetWaterLevel(CVector& vecPosition, float& fLevel, bool bCheckWaves, CVector& vecUnknown);
static bool GetWaterLevel(CClientWater* pWater, float& fLevel);
static bool GetWaterVertexPosition(CClientWater* pWater, int iVertexIndex, CVector& vecPosition);
static bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel);
static bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel);
static bool SetPositionWaterLevel(const CVector& vecPosition, float fLevel, void* pChangeSource);
static bool SetAllElementWaterLevel(float fLevel, void* pChangeSource);
static bool ResetWorldWaterLevel();
Expand Down
8 changes: 6 additions & 2 deletions Client/mods/deathmatch/logic/luadefs/CLuaWaterDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,24 @@ int CLuaWaterDefs::SetWaterLevel(lua_State* luaVM)
else
{
// Call type 3
// bool setWaterLevel ( float level, bool bIncludeWorldNonSeaLevel, bool bIncludeAllWaterElements )
// bool setWaterLevel ( float level, bool bIncludeWorldNonSeaLevel, bool bIncludeAllWaterElements, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel )
float fLevel;
bool bIncludeWorldNonSeaLevel;
bool bIncludeAllWaterElements;
bool bIncludeWorldSeaLevel;
bool bIncludeOutsideWorldLevel;

argStream.ReadNumber(fLevel);
argStream.ReadBool(bIncludeWorldNonSeaLevel, true);
argStream.ReadBool(bIncludeAllWaterElements, true);
argStream.ReadBool(bIncludeWorldSeaLevel, true);
argStream.ReadBool(bIncludeOutsideWorldLevel, false);

if (!argStream.HasErrors())
{
if (bIncludeAllWaterElements)
CStaticFunctionDefinitions::SetAllElementWaterLevel(fLevel, pResource);
if (CStaticFunctionDefinitions::SetWorldWaterLevel(fLevel, pResource, bIncludeWorldNonSeaLevel))
if (CStaticFunctionDefinitions::SetWorldWaterLevel(fLevel, pResource, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel))
{
lua_pushboolean(luaVM, true);
return 1;
Expand Down
11 changes: 9 additions & 2 deletions Client/mods/deathmatch/logic/rpc/CWaterRPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ void CWaterRPCs::LoadFunctions()
void CWaterRPCs::SetWorldWaterLevel(NetBitStreamInterface& bitStream)
{
float fLevel;
bool bIncludeWorldNonSeaLevel;
bool bIncludeWorldNonSeaLevel = true;
bool bIncludeWorldSeaLevel = true;
bool bIncludeOutsideWorldLevel = false;

if (bitStream.Read(fLevel) && bitStream.ReadBit(bIncludeWorldNonSeaLevel))
{
m_pWaterManager->SetWorldWaterLevel(fLevel, NULL, bIncludeWorldNonSeaLevel);
if (bitStream.Can(eBitStreamVersion::SetWaterLevel_ChangeOutsideWorldLevel))
{
bitStream.ReadBit(bIncludeWorldSeaLevel);
bitStream.ReadBit(bIncludeOutsideWorldLevel);
}
m_pWaterManager->SetWorldWaterLevel(fLevel, nullptr, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Client/sdk/game/CWaterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CWaterManager
virtual bool DeletePoly(CWaterPoly* pPoly) = 0;

virtual bool GetWaterLevel(const CVector& vecPosition, float* pfLevel, bool bCheckWaves, CVector* pvecUnknown) = 0;
virtual bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel) = 0;
virtual bool SetWorldWaterLevel(float fLevel, void* pChangeSource, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel) = 0;
virtual bool SetPositionWaterLevel(const CVector& vecPosition, float fLevel, void* pChangeSource) = 0;
virtual bool SetPolyWaterLevel(CWaterPoly* pPoly, float fLevel, void* pChangeSource) = 0;
virtual void ResetWorldWaterLevel() = 0;
Expand Down
6 changes: 4 additions & 2 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9161,13 +9161,15 @@ bool CStaticFunctionDefinitions::SetAllElementWaterLevel(float fLevel)
return true;
}

bool CStaticFunctionDefinitions::SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel)
bool CStaticFunctionDefinitions::SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel)
{
g_pGame->GetWaterManager()->SetWorldWaterLevel(fLevel, bIncludeWorldNonSeaLevel);
g_pGame->GetWaterManager()->SetWorldWaterLevel(fLevel, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel);

CBitStream BitStream;
BitStream.pBitStream->Write(fLevel);
BitStream.pBitStream->WriteBit(bIncludeWorldNonSeaLevel);
BitStream.pBitStream->WriteBit(bIncludeWorldSeaLevel);
BitStream.pBitStream->WriteBit(bIncludeOutsideWorldLevel);
m_pPlayerManager->BroadcastOnlyJoined(CLuaPacket(SET_WORLD_WATER_LEVEL, *BitStream.pBitStream));
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class CStaticFunctionDefinitions
static CWater* CreateWater(CResource* pResource, CVector* pV1, CVector* pV2, CVector* pV3, CVector* pV4, bool bShallow);
static bool SetElementWaterLevel(CWater* pWater, float fLevel);
static bool SetAllElementWaterLevel(float fLevel);
static bool SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel);
static bool SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel);
static bool ResetWorldWaterLevel();
static bool GetWaterVertexPosition(CWater* pWater, int iVertexIndex, CVector& vecPosition);
static bool SetWaterVertexPosition(CWater* pWater, int iVertexIndex, CVector& vecPosition);
Expand Down
16 changes: 14 additions & 2 deletions Server/mods/deathmatch/logic/CWaterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
CWaterManager::CWaterManager()
{
m_WorldWaterLevelInfo.bNonSeaLevelSet = false;
m_WorldWaterLevelInfo.bOutsideLevelSet = false;
m_WorldWaterLevelInfo.fSeaLevel = 0;
m_WorldWaterLevelInfo.fNonSeaLevel = 0;
m_WorldWaterLevelInfo.fOutsideLevel = 0;
m_fGlobalWaveHeight = 0.0f;
}

Expand Down Expand Up @@ -64,21 +66,31 @@ void CWaterManager::SetAllElementWaterLevel(float fLevel)
}
}

void CWaterManager::SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel)
void CWaterManager::SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel)
{
m_WorldWaterLevelInfo.fSeaLevel = fLevel;
if (bIncludeWorldSeaLevel)
{
m_WorldWaterLevelInfo.fSeaLevel = fLevel;
}
if (bIncludeWorldNonSeaLevel)
{
m_WorldWaterLevelInfo.bNonSeaLevelSet = true;
m_WorldWaterLevelInfo.fNonSeaLevel = fLevel;
}
if (bIncludeOutsideWorldLevel)
{
m_WorldWaterLevelInfo.bOutsideLevelSet = true;
m_WorldWaterLevelInfo.fOutsideLevel = fLevel;
}
}

void CWaterManager::ResetWorldWaterLevel()
{
m_WorldWaterLevelInfo.bNonSeaLevelSet = false;
m_WorldWaterLevelInfo.bOutsideLevelSet = false;
m_WorldWaterLevelInfo.fSeaLevel = 0;
m_WorldWaterLevelInfo.fNonSeaLevel = 0;
m_WorldWaterLevelInfo.fOutsideLevel = 0;
}

void CWaterManager::DeleteAll()
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CWaterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CWaterManager
void SetGlobalWaveHeight(float fHeight) { m_fGlobalWaveHeight = fHeight; }

const SWorldWaterLevelInfo& GetWorldWaterLevelInfo() const { return m_WorldWaterLevelInfo; }
void SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel);
void SetWorldWaterLevel(float fLevel, bool bIncludeWorldNonSeaLevel, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel);
void ResetWorldWaterLevel();
void SetElementWaterLevel(CWater* pWater, float fLevel);
void SetAllElementWaterLevel(float fLevel);
Expand Down
8 changes: 6 additions & 2 deletions Server/mods/deathmatch/logic/luadefs/CLuaWaterDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,24 @@ int CLuaWaterDefs::SetWaterLevel(lua_State* luaVM)
else
{
// Call type 2
// bool setWaterLevel ( float level, bool bIncludeWorldNonSeaLevel, bool bIncludeAllWaterElements )
// bool setWaterLevel ( float level, bool bIncludeWorldNonSeaLevel, bool bIncludeAllWaterElements, bool bIncludeWorldSeaLevel, bool bIncludeOutsideWorldLevel )
float fLevel;
bool bIncludeWorldNonSeaLevel;
bool bIncludeAllWaterElements;
bool bIncludeWorldSeaLevel;
bool bIncludeOutsideWorldLevel;

argStream.ReadNumber(fLevel);
argStream.ReadBool(bIncludeWorldNonSeaLevel, true);
argStream.ReadBool(bIncludeAllWaterElements, true);
argStream.ReadBool(bIncludeWorldSeaLevel, true);
argStream.ReadBool(bIncludeOutsideWorldLevel, false);

if (!argStream.HasErrors())
{
if (bIncludeAllWaterElements)
CStaticFunctionDefinitions::SetAllElementWaterLevel(fLevel);
if (CStaticFunctionDefinitions::SetWorldWaterLevel(fLevel, bIncludeWorldNonSeaLevel))
if (CStaticFunctionDefinitions::SetWorldWaterLevel(fLevel, bIncludeWorldNonSeaLevel, bIncludeWorldSeaLevel, bIncludeOutsideWorldLevel))
{
lua_pushboolean(luaVM, true);
return 1;
Expand Down
11 changes: 10 additions & 1 deletion Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,17 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const
BitStream.Write(m_WorldWaterLevelInfo.fSeaLevel);
BitStream.WriteBit(m_WorldWaterLevelInfo.bNonSeaLevelSet);
if (m_WorldWaterLevelInfo.bNonSeaLevelSet)
{
BitStream.Write(m_WorldWaterLevelInfo.fNonSeaLevel);

}
if (BitStream.Can(eBitStreamVersion::SetWaterLevel_ChangeOutsideWorldLevel))
{
BitStream.WriteBit(m_WorldWaterLevelInfo.bOutsideLevelSet);
if (m_WorldWaterLevelInfo.bOutsideLevelSet)
{
BitStream.Write(m_WorldWaterLevelInfo.fOutsideLevel);
}
}
BitStream.WriteCompressed(m_usFPSLimit);

// Write the garage states
Expand Down
2 changes: 2 additions & 0 deletions Server/mods/deathmatch/logic/packets/CMapInfoPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
struct SWorldWaterLevelInfo
{
bool bNonSeaLevelSet;
bool bOutsideLevelSet;
float fSeaLevel;
float fNonSeaLevel;
float fOutsideLevel;
};

class CMapInfoPacket : public CPacket
Expand Down
4 changes: 4 additions & 0 deletions Shared/sdk/net/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ enum class eBitStreamVersion : unsigned short
// 1.5.8 RELEASED - 2020-10-11
//

// setWaterLevel: add bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel
// 2020-11-03 0x70
SetWaterLevel_ChangeOutsideWorldLevel,

// This allows us to automatically increment the BitStreamVersion when things are added to this enum.
// Make sure you only add things above this comment.
Next,
Expand Down