Skip to content

Commit

Permalink
Merge branch 'master' into feature/extendedwatercannons
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX authored May 29, 2024
2 parents 0e23faf + c75ae36 commit 7b36084
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
21 changes: 19 additions & 2 deletions Client/mods/deathmatch/logic/CClientBuilding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "StdInc.h"

CClientBuilding::CClientBuilding(class CClientManager* pManager, ElementID ID, uint16_t usModelId, const CVector &pos, const CVector &rot, uint8_t interior)
CClientBuilding::CClientBuilding(class CClientManager* pManager, ElementID ID, uint16_t usModelId, const CVector& pos, const CVector& rot, uint8_t interior)
: ClassInit(this),
CClientEntity(ID),
m_pBuildingManager(pManager->GetBuildingManager()),
Expand All @@ -19,6 +19,7 @@ CClientBuilding::CClientBuilding(class CClientManager* pManager, ElementID ID, u
m_vRot(rot),
m_interior(interior),
m_pBuilding(nullptr),
m_usesCollision(true),
m_pHighBuilding(nullptr),
m_pLowBuilding(nullptr)
{
Expand Down Expand Up @@ -91,7 +92,7 @@ void CClientBuilding::SetInterior(uint8_t ucInterior)
return;
m_interior = ucInterior;
Recreate();
}
}

void CClientBuilding::SetModel(uint16_t model)
{
Expand All @@ -102,6 +103,18 @@ void CClientBuilding::SetModel(uint16_t model)
}
}

void CClientBuilding::SetUsesCollision(bool state)
{
if (m_usesCollision == state)
return;

m_usesCollision = state;
if (m_pBuilding)
{
m_pBuilding->SetUsesCollision(state);
}
}

void CClientBuilding::Create()
{
if (m_pBuilding)
Expand All @@ -115,6 +128,10 @@ void CClientBuilding::Create()

m_pBuilding = g_pGame->GetPools()->GetBuildingsPool().AddBuilding(this, m_usModelId, &m_vPos, &vRot4D, m_interior);

if (!m_usesCollision)
{
m_pBuilding->SetUsesCollision(m_usesCollision);
}
if (m_pHighBuilding)
{
m_pHighBuilding->GetBuildingEntity()->SetLod(m_pBuilding);
Expand Down
9 changes: 6 additions & 3 deletions Client/mods/deathmatch/logic/CClientBuilding.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class CClientBuilding : public CClientEntity

eClientEntityType GetType() const { return CCLIENTBUILDING; }

void SetUsesCollision(bool state);

void Create();
void Destroy();

bool IsValid() const noexcept { return m_pBuilding != nullptr; };


Expand All @@ -52,9 +57,6 @@ class CClientBuilding : public CClientEntity


private:
void Create();
void Destroy();

CClientBuilding* GetHighLodBuilding() const { return m_pHighBuilding; };
void SetHighLodBuilding(CClientBuilding* pHighBuilding = nullptr) { m_pHighBuilding = pHighBuilding; };

Expand All @@ -72,6 +74,7 @@ class CClientBuilding : public CClientEntity
CVector m_vPos;
CVector m_vRot;
uint8_t m_interior;
bool m_usesCollision;

CClientBuilding* m_pHighBuilding;
CClientBuilding* m_pLowBuilding;
Expand Down
5 changes: 5 additions & 0 deletions Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,11 @@ bool CStaticFunctionDefinitions::SetElementCollisionsEnabled(CClientEntity& Enti
Ped.SetUsesCollision(bEnabled);
break;
}
case CCLIENTBUILDING:
{
static_cast<CClientBuilding&>(Entity).SetUsesCollision(bEnabled);
break;
}
default:
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <lua/CLuaFunctionParser.h>
using std::list;

#define MIN_CLIENT_REQ_LOD_FOR_BUILDING "1.6.0-0.20000"
#define MIN_CLIENT_REQ_LOD_FOR_BUILDING "1.6.0-9.22470"

void CLuaElementDefs::LoadFunctions()
{
Expand Down
13 changes: 13 additions & 0 deletions Server/mods/deathmatch/logic/CResourceChecker.Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ namespace
{"createBuilding", "1.6.0-9.22410"},
{"restoreAllGameBuildings", "1.6.0-9.22420"},
{"removeAllGameBuildings", "1.6.0-9.22420"},
{"pathListDir", "1.6.0-9.22470"},
{"pathIsFile", "1.6.0-9.22470"},
{"pathIsDirectory", "1.6.0-9.22470"},
{"engineGetPoolCapacity", "1.6.0-9.22471"},
{"engineGetPoolDefaultCapacity", "1.6.0-9.22471"},
{"engineGetPoolUsedCapacity", "1.6.0-9.22471"},
{"engineSetPoolCapacity", "1.6.0-9.22471"},
};

SVersionItem serverFunctionInitList[] = {
Expand All @@ -58,6 +65,12 @@ namespace
{"onResourceStateChange", "1.6.0-9.22430"},
{"isObjectMoving", "1.6.0-9.22457"},
{"onPlayerTriggerInvalidEvent", "1.6.0-9.22459"},
{"pathListDir", "1.6.0-9.22470"},
{"pathIsFile", "1.6.0-9.22470"},
{"pathIsDirectory", "1.6.0-9.22470"},
{"onAccountCreate", "1.6.0-9.22470"},
{"onAccountRemove", "1.6.0-9.22470"},
{"getAccountType", "1.6.0-9.22470"},
};

//
Expand Down
4 changes: 2 additions & 2 deletions utils/buildactions/install_cef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ local CEF_URL_PREFIX = "https://cef-builds.spotifycdn.com/cef_binary_"
local CEF_URL_SUFFIX = "_windows32_minimal.tar.bz2"

-- Change here to update CEF version
local CEF_VERSION = "124.3.9+g9bd638f+chromium-124.0.6367.207"
local CEF_HASH = "9df7c9322b7fe9f2492888f5259090c3956fa5058193bdbf90a5a26547b9921e"
local CEF_VERSION = "125.0.19+g3d8f1c9+chromium-125.0.6422.112"
local CEF_HASH = "3d3c70fd78fa54be2bd5c4eebd252044a5096b11c42cd58bc3c6bbff96edc177"

function make_cef_download_url()
return CEF_URL_PREFIX..http.escapeUrlParam(CEF_VERSION)..CEF_URL_SUFFIX
Expand Down

0 comments on commit 7b36084

Please sign in to comment.