From 2d8bc47138c54de51956d882621da53913105d74 Mon Sep 17 00:00:00 2001 From: krisz7175 <64546635+Lamaaar@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:34:06 +0200 Subject: [PATCH 1/4] Add functionality to re-stream models separately engineRestreamModel - re-stream a specific model using it's ID engineRestream - re-stream a specific group of models (world, vehicles, peds, objects) --- Client/mods/deathmatch/logic/CClientGame.cpp | 51 ++++++++++++++++++- Client/mods/deathmatch/logic/CClientGame.h | 1 + .../logic/lua/CLuaFunctionParseHelpers.cpp | 7 +++ .../logic/lua/CLuaFunctionParseHelpers.h | 1 + .../logic/luadefs/CLuaEngineDefs.cpp | 15 ++++++ .../deathmatch/logic/luadefs/CLuaEngineDefs.h | 2 + Client/sdk/game/CStreaming.h | 8 +++ 7 files changed, 84 insertions(+), 1 deletion(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index 49343f0c9e2..ffcb1f7da08 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6748,7 +6748,7 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_setCallEvent("onClientBrowserWhitelistChange", Arguments, false); } -void CClientGame::RestreamModel(unsigned short usModel) +bool CClientGame::RestreamModel(unsigned short usModel) { // Is this a vehicle ID? if (CClientVehicleManager::IsValidModel(usModel)) @@ -6808,6 +6808,55 @@ void CClientGame::RestreamWorld() g_pGame->GetStreaming()->ReinitStreaming(); } +void CClientGame::Restream(std::optional option) +{ + if (!option.has_value()) + option = RestreamOption::ALL; + + if (option == RestreamOption::ALL || option == RestreamOption::VEHICLES) + { + for (const auto& model : m_pManager->GetModelManager()->GetModelsByType(eClientModelType::VEHICLE)) + { + g_pClientGame->GetModelCacheManager()->OnRestreamModel(model->GetModelID()); + } + + m_pManager->GetVehicleManager()->RestreamAllVehicles(); + } + + if (option == RestreamOption::ALL || option == RestreamOption::PEDS) + { + for (const auto& model : m_pManager->GetModelManager()->GetModelsByType(eClientModelType::PED)) + { + g_pClientGame->GetModelCacheManager()->OnRestreamModel(model->GetModelID()); + } + + m_pManager->GetPedManager()->RestreamAllPeds(); + } + + if (option == RestreamOption::ALL || option == RestreamOption::OBJECTS) + { + static constexpr eClientModelType restreamTypes[] = {eClientModelType::OBJECT, eClientModelType::OBJECT_DAMAGEABLE, eClientModelType::TIMED_OBJECT, + eClientModelType::CLUMP}; + + for (eClientModelType type : restreamTypes) + { + for (const auto& model : m_pManager->GetModelManager()->GetModelsByType(type)) + { + g_pClientGame->GetModelCacheManager()->OnRestreamModel(model->GetModelID()); + } + } + + m_pManager->GetObjectManager()->RestreamAllObjects(); + } + + if (option == RestreamOption::ALL) + { + m_pManager->GetPickupManager()->RestreamAllPickups(); + g_pGame->GetStreaming()->RemoveBigBuildings(); + g_pGame->GetStreaming()->ReinitStreaming(); + } +} + void CClientGame::ReinitMarkers() { g_pGame->Get3DMarkers()->ReinitMarkers(); diff --git a/Client/mods/deathmatch/logic/CClientGame.h b/Client/mods/deathmatch/logic/CClientGame.h index 0c33091763b..f2a26d98733 100644 --- a/Client/mods/deathmatch/logic/CClientGame.h +++ b/Client/mods/deathmatch/logic/CClientGame.h @@ -467,6 +467,7 @@ class CClientGame bool TriggerBrowserRequestResultEvent(const std::unordered_set& newPages); void RestreamModel(unsigned short usModel); void RestreamWorld(); + void Restream(std::optional option); void ReinitMarkers(); void OnWindowFocusChange(bool state); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp index eb3cb08904f..4e56e2d14f1 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp @@ -943,6 +943,13 @@ ADD_ENUM(PreloadAreaOption::COLLISIONS, "collisions") ADD_ENUM(PreloadAreaOption::ALL, "all") IMPLEMENT_ENUM_CLASS_END("preload-area-option") +IMPLEMENT_ENUM_CLASS_BEGIN(RestreamOption) +ADD_ENUM(RestreamOption::ALL, "world") +ADD_ENUM(RestreamOption::VEHICLES, "vehicles") +ADD_ENUM(RestreamOption::PEDS, "peds") +ADD_ENUM(RestreamOption::OBJECTS, "objects") +IMPLEMENT_ENUM_CLASS_END("restream-option") + IMPLEMENT_ENUM_CLASS_BEGIN(taskType) ADD_ENUM(taskType::PRIMARY_TASK, "primary") diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h index da35c0d1cc2..399cdbf2101 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h @@ -98,6 +98,7 @@ DECLARE_ENUM(ePools); DECLARE_ENUM_CLASS(WorldProperty); DECLARE_ENUM_CLASS(eModelLoadState); DECLARE_ENUM_CLASS(PreloadAreaOption); +DECLARE_ENUM_CLASS(RestreamOption); DECLARE_ENUM_CLASS(taskType); DECLARE_ENUM(eEntityType); DECLARE_ENUM_CLASS(VehicleAudioSettingProperty); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp index 3de38bbf76a..872e8eb2020 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp @@ -150,6 +150,9 @@ void CLuaEngineDefs::LoadFunctions() {"engineGetPoolUsedCapacity", ArgumentParser}, {"engineSetPoolCapacity", ArgumentParser}, {"enginePreloadWorldArea", ArgumentParser}, + {"engineRestreamModel", ArgumentParser}, + {"engineRestream", ArgumentParser}, + // CLuaCFunctions::AddFunction ( "engineReplaceMatchingAtomics", EngineReplaceMatchingAtomics ); // CLuaCFunctions::AddFunction ( "engineReplaceWheelAtomics", EngineReplaceWheelAtomics ); @@ -2593,3 +2596,15 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optionalGetStreaming()->LoadSceneCollision(&position); } + +bool CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId) +{ + return g_pClientGame->RestreamModel(modelId); +} + +bool CLuaEngineDefs::EngineRestream(std::optional option) +{ + g_pClientGame->Restream(option); + + return true; +} diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h index 48fa2706a41..8cee75b028c 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h @@ -96,6 +96,8 @@ class CLuaEngineDefs : public CLuaDefs static eModelLoadState EngineStreamingGetModelLoadState(std::uint16_t modelId); static void EnginePreloadWorldArea(CVector position, std::optional option); + static bool EngineRestreamModel(std::uint16_t modelId); + static bool EngineRestream(std::optional option); private: static void AddEngineColClass(lua_State* luaVM); diff --git a/Client/sdk/game/CStreaming.h b/Client/sdk/game/CStreaming.h index c463fb22b6f..765bfc1febf 100644 --- a/Client/sdk/game/CStreaming.h +++ b/Client/sdk/game/CStreaming.h @@ -44,6 +44,14 @@ enum class PreloadAreaOption ALL }; +enum class RestreamOption +{ + ALL = 0, + VEHICLES, + PEDS, + OBJECTS +}; + struct CStreamingInfo { uint16_t prevId = (uint16_t)-1; From bb3f487809c5f4fc7cece242e2c75f88d32792f8 Mon Sep 17 00:00:00 2001 From: krisz7175 <64546635+Lamaaar@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:36:26 +0200 Subject: [PATCH 2/4] Make suggested changes --- Client/mods/deathmatch/logic/CClientGame.cpp | 28 ++++++++++--------- Client/mods/deathmatch/logic/CClientGame.h | 2 +- .../logic/luadefs/CLuaEngineDefs.cpp | 2 +- .../deathmatch/logic/luadefs/CLuaEngineDefs.h | 2 +- Client/sdk/core/CClientBase.h | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index ffcb1f7da08..0c1bdeb6bab 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6748,47 +6748,49 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_setCallEvent("onClientBrowserWhitelistChange", Arguments, false); } -bool CClientGame::RestreamModel(unsigned short usModel) +bool CClientGame::RestreamModel(const std::uint16_t model) { // Is this a vehicle ID? - if (CClientVehicleManager::IsValidModel(usModel)) + if (CClientVehicleManager::IsValidModel(model)) { // Stream the vehicles of that model out so we have no // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. - m_pManager->GetVehicleManager()->RestreamVehicles(usModel); + m_pManager->GetVehicleManager()->RestreamVehicles(model); } // Is this an object ID? - else if (CClientObjectManager::IsValidModel(usModel)) + else if (CClientObjectManager::IsValidModel(model)) { - if (CClientPedManager::IsValidWeaponModel(usModel)) + if (CClientPedManager::IsValidWeaponModel(model)) { // Stream the weapon of that model out so we have no // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. - m_pManager->GetPedManager()->RestreamWeapon(usModel); - m_pManager->GetPickupManager()->RestreamPickups(usModel); + m_pManager->GetPedManager()->RestreamWeapon(model); + m_pManager->GetPickupManager()->RestreamPickups(model); } // Stream the objects of that model out so we have no // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. - m_pManager->GetObjectManager()->RestreamObjects(usModel); - g_pGame->GetModelInfo(usModel)->RestreamIPL(); + m_pManager->GetObjectManager()->RestreamObjects(model); + g_pGame->GetModelInfo(model)->RestreamIPL(); } // Is this an ped ID? - else if (CClientPlayerManager::IsValidModel(usModel)) + else if (CClientPlayerManager::IsValidModel(model)) { // Stream the ped of that model out so we have no // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. - m_pManager->GetPedManager()->RestreamPeds(usModel); + m_pManager->GetPedManager()->RestreamPeds(model); } else // 'Restream' upgrades after model replacement to propagate visual changes with immediate effect - if (CClientObjectManager::IsValidModel(usModel) && CVehicleUpgrades::IsUpgrade(usModel)) - m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(usModel); + if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model)) + m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model); + + return true; } void CClientGame::RestreamWorld() diff --git a/Client/mods/deathmatch/logic/CClientGame.h b/Client/mods/deathmatch/logic/CClientGame.h index f2a26d98733..b63503f478d 100644 --- a/Client/mods/deathmatch/logic/CClientGame.h +++ b/Client/mods/deathmatch/logic/CClientGame.h @@ -465,7 +465,7 @@ class CClientGame bool IsHighFloatPrecision() const; bool TriggerBrowserRequestResultEvent(const std::unordered_set& newPages); - void RestreamModel(unsigned short usModel); + bool RestreamModel(const std::uint16_t model); void RestreamWorld(); void Restream(std::optional option); void ReinitMarkers(); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp index 872e8eb2020..6cb543b43de 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp @@ -2597,7 +2597,7 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optionalGetStreaming()->LoadSceneCollision(&position); } -bool CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId) +bool CLuaEngineDefs::EngineRestreamModel(const std::uint16_t modelId) { return g_pClientGame->RestreamModel(modelId); } diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h index 8cee75b028c..d061e17d156 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h @@ -96,7 +96,7 @@ class CLuaEngineDefs : public CLuaDefs static eModelLoadState EngineStreamingGetModelLoadState(std::uint16_t modelId); static void EnginePreloadWorldArea(CVector position, std::optional option); - static bool EngineRestreamModel(std::uint16_t modelId); + static bool EngineRestreamModel(const std::uint16_t modelId); static bool EngineRestream(std::optional option); private: diff --git a/Client/sdk/core/CClientBase.h b/Client/sdk/core/CClientBase.h index c4ac679ec8c..fc5dbd44403 100644 --- a/Client/sdk/core/CClientBase.h +++ b/Client/sdk/core/CClientBase.h @@ -24,7 +24,7 @@ class CClientBase virtual void PreHUDRenderExecutionHandler(bool bDidUnminimize, bool bDidRecreateRenderTargets) = 0; virtual void PostFrameExecutionHandler() = 0; virtual void IdleHandler() = 0; - virtual void RestreamModel(unsigned short usModel) = 0; + virtual void RestreamModel(const std::uint16_t model) = 0; virtual bool WebsiteRequestResultHandler(const std::unordered_set& newPages) = 0; From f419fd6056c9893c9ba5c08666d35eafba0b83aa Mon Sep 17 00:00:00 2001 From: krisz7175 <64546635+Lamaaar@users.noreply.github.com> Date: Wed, 13 Aug 2025 18:55:20 +0200 Subject: [PATCH 3/4] Make suggested changes --- Client/mods/deathmatch/logic/CClientGame.cpp | 6 ++---- Client/mods/deathmatch/logic/CClientGame.h | 2 +- Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp | 8 +++----- Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h | 4 ++-- Client/sdk/core/CClientBase.h | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index 0c1bdeb6bab..ca6c7ef2358 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6748,7 +6748,7 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_setCallEvent("onClientBrowserWhitelistChange", Arguments, false); } -bool CClientGame::RestreamModel(const std::uint16_t model) +void CClientGame::RestreamModel(std::uint16_t model) { // Is this a vehicle ID? if (CClientVehicleManager::IsValidModel(model)) @@ -6789,8 +6789,6 @@ bool CClientGame::RestreamModel(const std::uint16_t model) // 'Restream' upgrades after model replacement to propagate visual changes with immediate effect if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model)) m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model); - - return true; } void CClientGame::RestreamWorld() @@ -6849,11 +6847,11 @@ void CClientGame::Restream(std::optional option) } m_pManager->GetObjectManager()->RestreamAllObjects(); + m_pManager->GetPickupManager()->RestreamAllPickups(); } if (option == RestreamOption::ALL) { - m_pManager->GetPickupManager()->RestreamAllPickups(); g_pGame->GetStreaming()->RemoveBigBuildings(); g_pGame->GetStreaming()->ReinitStreaming(); } diff --git a/Client/mods/deathmatch/logic/CClientGame.h b/Client/mods/deathmatch/logic/CClientGame.h index b63503f478d..b43f0de9c7d 100644 --- a/Client/mods/deathmatch/logic/CClientGame.h +++ b/Client/mods/deathmatch/logic/CClientGame.h @@ -465,7 +465,7 @@ class CClientGame bool IsHighFloatPrecision() const; bool TriggerBrowserRequestResultEvent(const std::unordered_set& newPages); - bool RestreamModel(const std::uint16_t model); + void RestreamModel(std::uint16_t model); void RestreamWorld(); void Restream(std::optional option); void ReinitMarkers(); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp index 6cb543b43de..08d4731f324 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp @@ -2597,14 +2597,12 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optionalGetStreaming()->LoadSceneCollision(&position); } -bool CLuaEngineDefs::EngineRestreamModel(const std::uint16_t modelId) +void CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId) { - return g_pClientGame->RestreamModel(modelId); + g_pClientGame->RestreamModel(modelId); } -bool CLuaEngineDefs::EngineRestream(std::optional option) +void CLuaEngineDefs::EngineRestream(std::optional option) { g_pClientGame->Restream(option); - - return true; } diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h index d061e17d156..e97614eca4a 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h @@ -96,8 +96,8 @@ class CLuaEngineDefs : public CLuaDefs static eModelLoadState EngineStreamingGetModelLoadState(std::uint16_t modelId); static void EnginePreloadWorldArea(CVector position, std::optional option); - static bool EngineRestreamModel(const std::uint16_t modelId); - static bool EngineRestream(std::optional option); + static void EngineRestreamModel(std::uint16_t modelId); + static void EngineRestream(std::optional option); private: static void AddEngineColClass(lua_State* luaVM); diff --git a/Client/sdk/core/CClientBase.h b/Client/sdk/core/CClientBase.h index fc5dbd44403..bbd8307e086 100644 --- a/Client/sdk/core/CClientBase.h +++ b/Client/sdk/core/CClientBase.h @@ -24,7 +24,7 @@ class CClientBase virtual void PreHUDRenderExecutionHandler(bool bDidUnminimize, bool bDidRecreateRenderTargets) = 0; virtual void PostFrameExecutionHandler() = 0; virtual void IdleHandler() = 0; - virtual void RestreamModel(const std::uint16_t model) = 0; + virtual void RestreamModel(std::uint16_t model) = 0; virtual bool WebsiteRequestResultHandler(const std::unordered_set& newPages) = 0; From be7fece04f21f159bc1c5a022d90a4c9977a1c0c Mon Sep 17 00:00:00 2001 From: krisz7175 <64546635+Lamaaar@users.noreply.github.com> Date: Wed, 13 Aug 2025 20:06:44 +0200 Subject: [PATCH 4/4] Make engineRestreamModel return bool --- Client/mods/deathmatch/logic/CClientGame.cpp | 21 ++++++++++++------- Client/mods/deathmatch/logic/CClientGame.h | 2 +- .../logic/luadefs/CLuaEngineDefs.cpp | 4 ++-- .../deathmatch/logic/luadefs/CLuaEngineDefs.h | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index ca6c7ef2358..95aae046f1d 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -6748,7 +6748,7 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_setCallEvent("onClientBrowserWhitelistChange", Arguments, false); } -void CClientGame::RestreamModel(std::uint16_t model) +bool CClientGame::RestreamModel(std::uint16_t model) { // Is this a vehicle ID? if (CClientVehicleManager::IsValidModel(model)) @@ -6757,8 +6757,9 @@ void CClientGame::RestreamModel(std::uint16_t model) // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. m_pManager->GetVehicleManager()->RestreamVehicles(model); - } + return true; + } // Is this an object ID? else if (CClientObjectManager::IsValidModel(model)) { @@ -6775,6 +6776,8 @@ void CClientGame::RestreamModel(std::uint16_t model) // eventually stream them back in with async loading. m_pManager->GetObjectManager()->RestreamObjects(model); g_pGame->GetModelInfo(model)->RestreamIPL(); + + return true; } // Is this an ped ID? else if (CClientPlayerManager::IsValidModel(model)) @@ -6783,12 +6786,16 @@ void CClientGame::RestreamModel(std::uint16_t model) // loaded when we do the restore. The streamer will // eventually stream them back in with async loading. m_pManager->GetPedManager()->RestreamPeds(model); - } - else - // 'Restream' upgrades after model replacement to propagate visual changes with immediate effect - if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model)) - m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model); + return true; + } + // 'Restream' upgrades after model replacement to propagate visual changes with immediate effect + else if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model)) + { + m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model); + return true; + } + return false; } void CClientGame::RestreamWorld() diff --git a/Client/mods/deathmatch/logic/CClientGame.h b/Client/mods/deathmatch/logic/CClientGame.h index b43f0de9c7d..c5470b875ed 100644 --- a/Client/mods/deathmatch/logic/CClientGame.h +++ b/Client/mods/deathmatch/logic/CClientGame.h @@ -465,7 +465,7 @@ class CClientGame bool IsHighFloatPrecision() const; bool TriggerBrowserRequestResultEvent(const std::unordered_set& newPages); - void RestreamModel(std::uint16_t model); + bool RestreamModel(std::uint16_t model); void RestreamWorld(); void Restream(std::optional option); void ReinitMarkers(); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp index 08d4731f324..7803aae8efb 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp @@ -2597,9 +2597,9 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optionalGetStreaming()->LoadSceneCollision(&position); } -void CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId) +bool CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId) { - g_pClientGame->RestreamModel(modelId); + return g_pClientGame->RestreamModel(modelId); } void CLuaEngineDefs::EngineRestream(std::optional option) diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h index e97614eca4a..6a107c0ded0 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h @@ -96,7 +96,7 @@ class CLuaEngineDefs : public CLuaDefs static eModelLoadState EngineStreamingGetModelLoadState(std::uint16_t modelId); static void EnginePreloadWorldArea(CVector position, std::optional option); - static void EngineRestreamModel(std::uint16_t modelId); + static bool EngineRestreamModel(std::uint16_t modelId); static void EngineRestream(std::optional option); private: