From 7224d1b16659483b26b3112aa3a718359fc5fc54 Mon Sep 17 00:00:00 2001 From: FileEX Date: Mon, 22 Jul 2024 02:10:17 +0200 Subject: [PATCH 1/6] Add new property flyingcomponents special world property --- Client/mods/deathmatch/logic/CClientGame.cpp | 6 ++++++ .../mods/deathmatch/logic/CClientVehicle.cpp | 11 ++++++---- .../logic/CClientVehicleManager.cpp | 1 + .../deathmatch/logic/CClientVehicleManager.h | 4 ++++ Client/mods/deathmatch/logic/CNetAPI.cpp | 5 +++-- .../mods/deathmatch/logic/CPacketHandler.cpp | 12 +++++++---- Server/mods/deathmatch/logic/CGame.cpp | 1 + .../logic/packets/CMapInfoPacket.cpp | 2 ++ Shared/mods/deathmatch/logic/Enums.cpp | 1 + Shared/mods/deathmatch/logic/Enums.h | 1 + Shared/sdk/net/SyncStructures.h | 20 ++++++++++++++++++- Shared/sdk/net/bitstream.h | 6 +++++- 12 files changed, 58 insertions(+), 12 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index eea07ffd33..2d6789712e 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6107,12 +6107,16 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is return true; case WorldSpecialProperty::EXTENDEDWATERCANNONS: g_pGame->SetExtendedWaterCannonsEnabled(isEnabled); + return true; case WorldSpecialProperty::ROADSIGNSTEXT: g_pGame->SetRoadSignsTextEnabled(isEnabled); return true; case WorldSpecialProperty::TUNNELWEATHERBLEND: g_pGame->SetTunnelWeatherBlendEnabled(isEnabled); return true; + case WorldSpecialProperty::FLYINGCOMPONENTS: + m_pVehicleManager->SetSpawnFlyingComponentEnabled(isEnabled); + return true; } return false; } @@ -6150,6 +6154,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property) return g_pGame->IsRoadSignsTextEnabled(); case WorldSpecialProperty::TUNNELWEATHERBLEND: return g_pGame->IsTunnelWeatherBlendEnabled(); + case WorldSpecialProperty::FLYINGCOMPONENTS: + return m_pVehicleManager->IsSpawnFlyingComponentEnabled(); } return false; } diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index 42b2215adc..48566bb3f3 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -811,10 +811,12 @@ void CClientVehicle::Fix() SFixedArray ucDoorStates; GetInitialDoorStates(ucDoorStates); + + bool flyingComponents = m_pVehicleManager->IsSpawnFlyingComponentEnabled(); for (int i = 0; i < MAX_DOORS; i++) - SetDoorStatus(i, ucDoorStates[i], true); + SetDoorStatus(i, ucDoorStates[i], flyingComponents); for (int i = 0; i < MAX_PANELS; i++) - SetPanelStatus(i, 0); + SetPanelStatus(i, 0, flyingComponents); for (int i = 0; i < MAX_LIGHTS; i++) SetLightStatus(i, 0); for (int i = 0; i < MAX_WHEELS; i++) @@ -2156,11 +2158,12 @@ void CClientVehicle::StreamedInPulse() { // Set the damage model doors CDamageManager* pDamageManager = m_pVehicle->GetDamageManager(); + bool flyingComponents = m_pVehicleManager->IsSpawnFlyingComponentEnabled(); for (int i = 0; i < MAX_DOORS; i++) - pDamageManager->SetDoorStatus(static_cast(i), m_ucDoorStates[i], true); + pDamageManager->SetDoorStatus(static_cast(i), m_ucDoorStates[i], flyingComponents); for (int i = 0; i < MAX_PANELS; i++) - pDamageManager->SetPanelStatus(static_cast(i), m_ucPanelStates[i]); + pDamageManager->SetPanelStatus(static_cast(i), m_ucPanelStates[i], flyingComponents); for (int i = 0; i < MAX_LIGHTS; i++) pDamageManager->SetLightStatus(static_cast(i), m_ucLightStates[i]); } diff --git a/Client/mods/deathmatch/logic/CClientVehicleManager.cpp b/Client/mods/deathmatch/logic/CClientVehicleManager.cpp index 67abb03f5e..2077fce7e6 100644 --- a/Client/mods/deathmatch/logic/CClientVehicleManager.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicleManager.cpp @@ -61,6 +61,7 @@ CClientVehicleManager::CClientVehicleManager(CClientManager* pManager) // Initialize members m_pManager = pManager; m_bCanRemoveFromList = true; + m_spawnFlyingComponentsDuringRecreate = true; int iVehicleID = 0; for (int i = 0; i < 212; i++) diff --git a/Client/mods/deathmatch/logic/CClientVehicleManager.h b/Client/mods/deathmatch/logic/CClientVehicleManager.h index 2f062d650a..ec105bcc90 100644 --- a/Client/mods/deathmatch/logic/CClientVehicleManager.h +++ b/Client/mods/deathmatch/logic/CClientVehicleManager.h @@ -70,9 +70,13 @@ class CClientVehicleManager void OnCreation(CClientVehicle* pVehicle); void OnDestruction(CClientVehicle* pVehicle); + bool IsSpawnFlyingComponentEnabled() const noexcept { return m_spawnFlyingComponentsDuringRecreate; } + void SetSpawnFlyingComponentEnabled(bool isEnabled) noexcept { m_spawnFlyingComponentsDuringRecreate = isEnabled; } + protected: CClientManager* m_pManager; bool m_bCanRemoveFromList; CMappedArray m_List; CMappedArray m_StreamedIn; + bool m_spawnFlyingComponentsDuringRecreate; }; diff --git a/Client/mods/deathmatch/logic/CNetAPI.cpp b/Client/mods/deathmatch/logic/CNetAPI.cpp index a6238512c7..3f5c2f11d0 100644 --- a/Client/mods/deathmatch/logic/CNetAPI.cpp +++ b/Client/mods/deathmatch/logic/CNetAPI.cpp @@ -2234,10 +2234,11 @@ void CNetAPI::ReadVehiclePartsState(CClientVehicle* pVehicle, NetBitStreamInterf SVehicleDamageSyncMethodeB damage; BitStream.Read(&damage); + bool flyingComponents = m_pVehicleManager->IsSpawnFlyingComponentEnabled(); if (damage.data.bSyncDoors) for (unsigned int i = 0; i < MAX_DOORS; ++i) - pVehicle->SetDoorStatus(i, damage.data.doors.data.ucStates[i], true); + pVehicle->SetDoorStatus(i, damage.data.doors.data.ucStates[i], flyingComponents); if (damage.data.bSyncWheels) for (unsigned int i = 0; i < MAX_WHEELS; ++i) @@ -2245,7 +2246,7 @@ void CNetAPI::ReadVehiclePartsState(CClientVehicle* pVehicle, NetBitStreamInterf if (damage.data.bSyncPanels) for (unsigned int i = 0; i < MAX_PANELS; ++i) - pVehicle->SetPanelStatus(i, damage.data.panels.data.ucStates[i]); + pVehicle->SetPanelStatus(i, damage.data.panels.data.ucStates[i], flyingComponents); if (damage.data.bSyncLights) for (unsigned int i = 0; i < MAX_LIGHTS; ++i) diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index ed8ba623c1..c24c847d89 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -1624,10 +1624,12 @@ void CPacketHandler::Packet_VehicleDamageSync(NetBitStreamInterface& bitStream) CDeathmatchVehicle* pVehicle = static_cast(g_pClientGame->m_pVehicleManager->Get(ID)); if (pVehicle) { + bool flyingComponents = g_pClientGame->IsWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS); + for (unsigned int i = 0; i < MAX_DOORS; ++i) { if (damage.data.bDoorStatesChanged[i]) - pVehicle->SetDoorStatus(i, damage.data.ucDoorStates[i], true); + pVehicle->SetDoorStatus(i, damage.data.ucDoorStates[i], flyingComponents); } for (unsigned int i = 0; i < MAX_WHEELS; ++i) { @@ -1637,7 +1639,7 @@ void CPacketHandler::Packet_VehicleDamageSync(NetBitStreamInterface& bitStream) for (unsigned int i = 0; i < MAX_PANELS; ++i) { if (damage.data.bPanelStatesChanged[i]) - pVehicle->SetPanelStatus(i, damage.data.ucPanelStates[i]); + pVehicle->SetPanelStatus(i, damage.data.ucPanelStates[i], flyingComponents); } for (unsigned int i = 0; i < MAX_LIGHTS; ++i) { @@ -2393,6 +2395,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream) g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend); + g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS, wsProps.data6.flyingcomponents); float fJetpackMaxHeight = 100; if (!bitStream.Read(fJetpackMaxHeight)) @@ -3382,13 +3385,14 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream) pVehicle->SetPaintjob(paintjob.data.ucPaintjob); pVehicle->SetColor(vehColor); + bool flyingComponents = g_pClientGame->IsWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS); // Setup our damage model for (int i = 0; i < MAX_DOORS; i++) - pVehicle->SetDoorStatus(i, damage.data.ucDoorStates[i], true); + pVehicle->SetDoorStatus(i, damage.data.ucDoorStates[i], flyingComponents); for (int i = 0; i < MAX_WHEELS; i++) pVehicle->SetWheelStatus(i, damage.data.ucWheelStates[i]); for (int i = 0; i < MAX_PANELS; i++) - pVehicle->SetPanelStatus(i, damage.data.ucPanelStates[i]); + pVehicle->SetPanelStatus(i, damage.data.ucPanelStates[i], flyingComponents); for (int i = 0; i < MAX_LIGHTS; i++) pVehicle->SetLightStatus(i, damage.data.ucLightStates[i]); pVehicle->ResetDamageModelSync(); diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index 5e170324b5..43abda9ca9 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -249,6 +249,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true; m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true; m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true; + m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = true; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; m_JetpackWeapons[WEAPONTYPE_TEC9] = true; diff --git a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp index e62547b3fb..155885d775 100644 --- a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp @@ -192,6 +192,8 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const wsProps.data3.roadsignstext = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::ROADSIGNSTEXT); wsProps.data4.extendedwatercannons = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::EXTENDEDWATERCANNONS); wsProps.data5.tunnelweatherblend = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::TUNNELWEATHERBLEND); + wsProps.data6.flyingcomponents = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::FLYINGCOMPONENTS); + BitStream.Write(&wsProps); } diff --git a/Shared/mods/deathmatch/logic/Enums.cpp b/Shared/mods/deathmatch/logic/Enums.cpp index 1e3d0b2003..ea12bc8c89 100644 --- a/Shared/mods/deathmatch/logic/Enums.cpp +++ b/Shared/mods/deathmatch/logic/Enums.cpp @@ -101,6 +101,7 @@ ADD_ENUM(WorldSpecialProperty::FIREBALLDESTRUCT, "fireballdestruct") ADD_ENUM(WorldSpecialProperty::EXTENDEDWATERCANNONS, "extendedwatercannons") ADD_ENUM(WorldSpecialProperty::ROADSIGNSTEXT, "roadsignstext") ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend") +ADD_ENUM(WorldSpecialProperty::FLYINGCOMPONENTS, "flyingcomponents") IMPLEMENT_ENUM_CLASS_END("world-special-property") IMPLEMENT_ENUM_BEGIN(ePacketID) diff --git a/Shared/mods/deathmatch/logic/Enums.h b/Shared/mods/deathmatch/logic/Enums.h index e975d0d907..c469362d79 100644 --- a/Shared/mods/deathmatch/logic/Enums.h +++ b/Shared/mods/deathmatch/logic/Enums.h @@ -91,6 +91,7 @@ enum class WorldSpecialProperty ROADSIGNSTEXT, EXTENDEDWATERCANNONS, TUNNELWEATHERBLEND, + FLYINGCOMPONENTS, }; DECLARE_ENUM_CLASS(WorldSpecialProperty); diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index 1e9b8215b3..ccff331a72 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2044,6 +2044,10 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure { BITCOUNT5 = 1 }; + enum + { + BITCOUNT6 = 1 + }; bool Read(NetBitStreamInterface& bitStream) { @@ -2068,6 +2072,11 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure else data5.tunnelweatherblend = true; + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_FlyingComponents)) + isOK &= bitStream.ReadBits(reinterpret_cast(&data6), BITCOUNT6); + else + data6.flyingcomponents = true; + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // isOK &= bitStream.ReadBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2091,6 +2100,9 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_TunnelWeatherBlend)) bitStream.WriteBits(reinterpret_cast(&data5), BITCOUNT5); + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_FlyingComponents)) + bitStream.WriteBits(reinterpret_cast(&data6), BITCOUNT6); + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // bitStream.WriteBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2132,7 +2144,12 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure { bool tunnelweatherblend : 1; } data5; - + + struct + { + bool flyingcomponents : 1; + } data6; + SWorldSpecialPropertiesStateSync() { // Set default states @@ -2152,6 +2169,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data3.roadsignstext = true; data4.extendedwatercannons = true; data5.tunnelweatherblend = true; + data6.flyingcomponents = true; } }; diff --git a/Shared/sdk/net/bitstream.h b/Shared/sdk/net/bitstream.h index e4dc40adf2..805a8473b6 100644 --- a/Shared/sdk/net/bitstream.h +++ b/Shared/sdk/net/bitstream.h @@ -556,7 +556,7 @@ enum class eBitStreamVersion : unsigned short // 2024-06-16 PedSync_Revision, - // Add "extendedwatercannons" to setWorldSpecialPropertyEnabled + // Add "tunnelweatherblend" to setWorldSpecialPropertyEnabled // 2024-06-30 WorldSpecialProperty_TunnelWeatherBlend, @@ -568,6 +568,10 @@ enum class eBitStreamVersion : unsigned short // 2024-07-05 SetMarkerTargetArrowProperties, + // Add "flyingcomponents" to setWorldSpecialPropertyEnabled + // 2024-07-22 + WorldSpecialProperty_FlyingComponents, + // 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, From 67f2898f672ea43f2ef7befe4db1898e270ef169 Mon Sep 17 00:00:00 2001 From: FileEX Date: Sat, 5 Oct 2024 17:51:13 +0200 Subject: [PATCH 2/6] Disable by default --- Server/mods/deathmatch/logic/CGame.cpp | 2 +- Shared/sdk/net/SyncStructures.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index 43abda9ca9..e0f6e440ca 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -249,7 +249,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true; m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true; m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true; - m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = true; + m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = false; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; m_JetpackWeapons[WEAPONTYPE_TEC9] = true; diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index ccff331a72..217d8936f4 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2169,7 +2169,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data3.roadsignstext = true; data4.extendedwatercannons = true; data5.tunnelweatherblend = true; - data6.flyingcomponents = true; + data6.flyingcomponents = false; } }; From 7dcd5e90056a13c337c8972753d5f501a535dec8 Mon Sep 17 00:00:00 2001 From: FileEX Date: Mon, 6 Jan 2025 18:36:59 +0100 Subject: [PATCH 3/6] Update CPacketHandler.cpp --- Client/mods/deathmatch/logic/CPacketHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index 074bfe3406..094812d816 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -2400,7 +2400,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream) g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::IGNOREFIRESTATE, wsProps.data6.ignoreFireState); - g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS, wsProps.data6.flyingcomponents); + g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FLYINGCOMPONENTS, wsProps.data7.flyingcomponents); float fJetpackMaxHeight = 100; if (!bitStream.Read(fJetpackMaxHeight)) From 6de19020a6d5476e86ac3aa32d7c0fe25df03f9a Mon Sep 17 00:00:00 2001 From: FileEX Date: Mon, 6 Jan 2025 18:37:32 +0100 Subject: [PATCH 4/6] Update bitstream.h --- Shared/sdk/net/bitstream.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shared/sdk/net/bitstream.h b/Shared/sdk/net/bitstream.h index e6d49f2600..9bfbbd0b84 100644 --- a/Shared/sdk/net/bitstream.h +++ b/Shared/sdk/net/bitstream.h @@ -571,10 +571,6 @@ enum class eBitStreamVersion : unsigned short // Add respawnObject and toggleObjectRespawn to serverside // 2024-09-04 RespawnObject_Serverside, - - // Add "flyingcomponents" to setWorldSpecialPropertyEnabled - // 2024-07-22 - WorldSpecialProperty_FlyingComponents, // Add check_duplicate_serials // 2024-09-04 @@ -604,6 +600,10 @@ enum class eBitStreamVersion : unsigned short // 2025-01-01 AnimationsSync, + // Add "flyingcomponents" to setWorldSpecialPropertyEnabled + // 2024-07-22 + WorldSpecialProperty_FlyingComponents, + // 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, From 1e064bc31bebd179d3ab11e988dc27e4c115bac5 Mon Sep 17 00:00:00 2001 From: Marek Kulik Date: Fri, 10 Jan 2025 21:46:13 +0100 Subject: [PATCH 5/6] Apply suggestions from code review --- Client/mods/deathmatch/logic/CClientVehicleManager.cpp | 1 - Client/mods/deathmatch/logic/CClientVehicleManager.h | 2 +- Server/mods/deathmatch/logic/CGame.cpp | 2 +- Shared/sdk/net/SyncStructures.h | 4 +--- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientVehicleManager.cpp b/Client/mods/deathmatch/logic/CClientVehicleManager.cpp index 2077fce7e6..67abb03f5e 100644 --- a/Client/mods/deathmatch/logic/CClientVehicleManager.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicleManager.cpp @@ -61,7 +61,6 @@ CClientVehicleManager::CClientVehicleManager(CClientManager* pManager) // Initialize members m_pManager = pManager; m_bCanRemoveFromList = true; - m_spawnFlyingComponentsDuringRecreate = true; int iVehicleID = 0; for (int i = 0; i < 212; i++) diff --git a/Client/mods/deathmatch/logic/CClientVehicleManager.h b/Client/mods/deathmatch/logic/CClientVehicleManager.h index ec105bcc90..5f0ad55f61 100644 --- a/Client/mods/deathmatch/logic/CClientVehicleManager.h +++ b/Client/mods/deathmatch/logic/CClientVehicleManager.h @@ -78,5 +78,5 @@ class CClientVehicleManager bool m_bCanRemoveFromList; CMappedArray m_List; CMappedArray m_StreamedIn; - bool m_spawnFlyingComponentsDuringRecreate; + bool m_spawnFlyingComponentsDuringRecreate{true}; }; diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index 717ea3eb9f..82ba250ba5 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -260,7 +260,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true; m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true; m_WorldSpecialProps[WorldSpecialProperty::IGNOREFIRESTATE] = false; - m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = false; + m_WorldSpecialProps[WorldSpecialProperty::FLYINGCOMPONENTS] = true; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; m_JetpackWeapons[WEAPONTYPE_TEC9] = true; diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index fb49d57fef..b9824ad74e 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2141,8 +2141,6 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_FlyingComponents)) bitStream.WriteBits(reinterpret_cast(&data7), BITCOUNT7); - - //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // bitStream.WriteBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2215,7 +2213,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data4.extendedwatercannons = true; data5.tunnelweatherblend = true; data6.ignoreFireState = false; - data7.flyingcomponents = false; + data7.flyingcomponents = true; } }; From 0ccdcdda658214e3bb3c1d158ffb3b2dff85966e Mon Sep 17 00:00:00 2001 From: Marek Kulik Date: Fri, 10 Jan 2025 21:47:23 +0100 Subject: [PATCH 6/6] Update Shared/sdk/net/SyncStructures.h --- Shared/sdk/net/SyncStructures.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index b9824ad74e..afa32a05f0 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2141,6 +2141,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_FlyingComponents)) bitStream.WriteBits(reinterpret_cast(&data7), BITCOUNT7); + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // bitStream.WriteBits(reinterpret_cast(&data9), BITCOUNT9);