From 508111138585000bac01b39c157e465fd9e88aaa Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Tue, 28 May 2024 23:17:43 +0300 Subject: [PATCH 1/4] Allow setElementCollisionsEnabled for buildings (PR #3384) --- .../mods/deathmatch/logic/CClientBuilding.cpp | 21 +++++++++++++++++-- .../mods/deathmatch/logic/CClientBuilding.h | 9 +++++--- .../logic/CStaticFunctionDefinitions.cpp | 5 +++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientBuilding.cpp b/Client/mods/deathmatch/logic/CClientBuilding.cpp index df8006f620..68d435011c 100644 --- a/Client/mods/deathmatch/logic/CClientBuilding.cpp +++ b/Client/mods/deathmatch/logic/CClientBuilding.cpp @@ -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()), @@ -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) { @@ -91,7 +92,7 @@ void CClientBuilding::SetInterior(uint8_t ucInterior) return; m_interior = ucInterior; Recreate(); -} +} void CClientBuilding::SetModel(uint16_t model) { @@ -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) @@ -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); diff --git a/Client/mods/deathmatch/logic/CClientBuilding.h b/Client/mods/deathmatch/logic/CClientBuilding.h index 2a45673bce..aa33cd5034 100644 --- a/Client/mods/deathmatch/logic/CClientBuilding.h +++ b/Client/mods/deathmatch/logic/CClientBuilding.h @@ -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; }; @@ -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; }; @@ -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; diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index cacd3290ad..cb0466e894 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -3756,6 +3756,11 @@ bool CStaticFunctionDefinitions::SetElementCollisionsEnabled(CClientEntity& Enti Ped.SetUsesCollision(bEnabled); break; } + case CCLIENTBUILDING: + { + static_cast(Entity).SetUsesCollision(bEnabled); + break; + } default: return false; } From 725e98e94e6a11577cbaad6acc3d2e61bdab432e Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Tue, 28 May 2024 23:35:33 +0300 Subject: [PATCH 2/4] Add new functions to resource checker (#3409) --- .../mods/deathmatch/logic/CResourceChecker.Data.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Server/mods/deathmatch/logic/CResourceChecker.Data.h b/Server/mods/deathmatch/logic/CResourceChecker.Data.h index 8809ab28f9..a0234eb386 100644 --- a/Server/mods/deathmatch/logic/CResourceChecker.Data.h +++ b/Server/mods/deathmatch/logic/CResourceChecker.Data.h @@ -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[] = { @@ -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"}, }; // From d60bc4c58967f6ce87848f9682629371c20ea514 Mon Sep 17 00:00:00 2001 From: Sarrum <12110157+theSarrum@users.noreply.github.com> Date: Wed, 29 May 2024 00:50:08 +0300 Subject: [PATCH 3/4] Update MIN_CLIENT_REQ_LOD_FOR_BUILDING (#3411) --- Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp index 621cc1c5a3..e88f8f6751 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp @@ -14,7 +14,7 @@ #include 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() { From c75ae3631c2cc7f20ad5ec851929c5cb08fd6404 Mon Sep 17 00:00:00 2001 From: Dutchman101 <12105539+Dutchman101@users.noreply.github.com> Date: Tue, 28 May 2024 22:52:40 +0000 Subject: [PATCH 4/4] Update CEF to 125.0.19+g3d8f1c9+chromium-125.0.6422.112 --- utils/buildactions/install_cef.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/buildactions/install_cef.lua b/utils/buildactions/install_cef.lua index 06d150f80b..c1b2625c0a 100644 --- a/utils/buildactions/install_cef.lua +++ b/utils/buildactions/install_cef.lua @@ -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