@@ -6748,7 +6748,7 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_set<SStr
67486748 return GetRootEntity ()->CallEvent (" onClientBrowserWhitelistChange" , Arguments, false );
67496749}
67506750
6751- void CClientGame::RestreamModel (unsigned short usModel)
6751+ bool CClientGame::RestreamModel (unsigned short usModel)
67526752{
67536753 // Is this a vehicle ID?
67546754 if (CClientVehicleManager::IsValidModel (usModel))
@@ -6808,6 +6808,55 @@ void CClientGame::RestreamWorld()
68086808 g_pGame->GetStreaming ()->ReinitStreaming ();
68096809}
68106810
6811+ void CClientGame::Restream (std::optional<RestreamOption> option)
6812+ {
6813+ if (!option.has_value ())
6814+ option = RestreamOption::ALL;
6815+
6816+ if (option == RestreamOption::ALL || option == RestreamOption::VEHICLES)
6817+ {
6818+ for (const auto & model : m_pManager->GetModelManager ()->GetModelsByType (eClientModelType::VEHICLE))
6819+ {
6820+ g_pClientGame->GetModelCacheManager ()->OnRestreamModel (model->GetModelID ());
6821+ }
6822+
6823+ m_pManager->GetVehicleManager ()->RestreamAllVehicles ();
6824+ }
6825+
6826+ if (option == RestreamOption::ALL || option == RestreamOption::PEDS)
6827+ {
6828+ for (const auto & model : m_pManager->GetModelManager ()->GetModelsByType (eClientModelType::PED))
6829+ {
6830+ g_pClientGame->GetModelCacheManager ()->OnRestreamModel (model->GetModelID ());
6831+ }
6832+
6833+ m_pManager->GetPedManager ()->RestreamAllPeds ();
6834+ }
6835+
6836+ if (option == RestreamOption::ALL || option == RestreamOption::OBJECTS)
6837+ {
6838+ static constexpr eClientModelType restreamTypes[] = {eClientModelType::OBJECT, eClientModelType::OBJECT_DAMAGEABLE, eClientModelType::TIMED_OBJECT,
6839+ eClientModelType::CLUMP};
6840+
6841+ for (eClientModelType type : restreamTypes)
6842+ {
6843+ for (const auto & model : m_pManager->GetModelManager ()->GetModelsByType (type))
6844+ {
6845+ g_pClientGame->GetModelCacheManager ()->OnRestreamModel (model->GetModelID ());
6846+ }
6847+ }
6848+
6849+ m_pManager->GetObjectManager ()->RestreamAllObjects ();
6850+ }
6851+
6852+ if (option == RestreamOption::ALL)
6853+ {
6854+ m_pManager->GetPickupManager ()->RestreamAllPickups ();
6855+ g_pGame->GetStreaming ()->RemoveBigBuildings ();
6856+ g_pGame->GetStreaming ()->ReinitStreaming ();
6857+ }
6858+ }
6859+
68116860void CClientGame::ReinitMarkers ()
68126861{
68136862 g_pGame->Get3DMarkers ()->ReinitMarkers ();
0 commit comments