Skip to content

Commit bb3f487

Browse files
committed
Make suggested changes
1 parent 2d8bc47 commit bb3f487

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6748,47 +6748,49 @@ bool CClientGame::TriggerBrowserRequestResultEvent(const std::unordered_set<SStr
67486748
return GetRootEntity()->CallEvent("onClientBrowserWhitelistChange", Arguments, false);
67496749
}
67506750

6751-
bool CClientGame::RestreamModel(unsigned short usModel)
6751+
bool CClientGame::RestreamModel(const std::uint16_t model)
67526752
{
67536753
// Is this a vehicle ID?
6754-
if (CClientVehicleManager::IsValidModel(usModel))
6754+
if (CClientVehicleManager::IsValidModel(model))
67556755
{
67566756
// Stream the vehicles of that model out so we have no
67576757
// loaded when we do the restore. The streamer will
67586758
// eventually stream them back in with async loading.
6759-
m_pManager->GetVehicleManager()->RestreamVehicles(usModel);
6759+
m_pManager->GetVehicleManager()->RestreamVehicles(model);
67606760
}
67616761

67626762
// Is this an object ID?
6763-
else if (CClientObjectManager::IsValidModel(usModel))
6763+
else if (CClientObjectManager::IsValidModel(model))
67646764
{
6765-
if (CClientPedManager::IsValidWeaponModel(usModel))
6765+
if (CClientPedManager::IsValidWeaponModel(model))
67666766
{
67676767
// Stream the weapon of that model out so we have no
67686768
// loaded when we do the restore. The streamer will
67696769
// eventually stream them back in with async loading.
6770-
m_pManager->GetPedManager()->RestreamWeapon(usModel);
6771-
m_pManager->GetPickupManager()->RestreamPickups(usModel);
6770+
m_pManager->GetPedManager()->RestreamWeapon(model);
6771+
m_pManager->GetPickupManager()->RestreamPickups(model);
67726772
}
67736773
// Stream the objects of that model out so we have no
67746774
// loaded when we do the restore. The streamer will
67756775
// eventually stream them back in with async loading.
6776-
m_pManager->GetObjectManager()->RestreamObjects(usModel);
6777-
g_pGame->GetModelInfo(usModel)->RestreamIPL();
6776+
m_pManager->GetObjectManager()->RestreamObjects(model);
6777+
g_pGame->GetModelInfo(model)->RestreamIPL();
67786778
}
67796779
// Is this an ped ID?
6780-
else if (CClientPlayerManager::IsValidModel(usModel))
6780+
else if (CClientPlayerManager::IsValidModel(model))
67816781
{
67826782
// Stream the ped of that model out so we have no
67836783
// loaded when we do the restore. The streamer will
67846784
// eventually stream them back in with async loading.
6785-
m_pManager->GetPedManager()->RestreamPeds(usModel);
6785+
m_pManager->GetPedManager()->RestreamPeds(model);
67866786
}
67876787
else
67886788

67896789
// 'Restream' upgrades after model replacement to propagate visual changes with immediate effect
6790-
if (CClientObjectManager::IsValidModel(usModel) && CVehicleUpgrades::IsUpgrade(usModel))
6791-
m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(usModel);
6790+
if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model))
6791+
m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model);
6792+
6793+
return true;
67926794
}
67936795

67946796
void CClientGame::RestreamWorld()

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ class CClientGame
465465
bool IsHighFloatPrecision() const;
466466

467467
bool TriggerBrowserRequestResultEvent(const std::unordered_set<SString>& newPages);
468-
void RestreamModel(unsigned short usModel);
468+
bool RestreamModel(const std::uint16_t model);
469469
void RestreamWorld();
470470
void Restream(std::optional<RestreamOption> option);
471471
void ReinitMarkers();

Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2597,7 +2597,7 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optional<Prel
25972597
g_pGame->GetStreaming()->LoadSceneCollision(&position);
25982598
}
25992599

2600-
bool CLuaEngineDefs::EngineRestreamModel(std::uint16_t modelId)
2600+
bool CLuaEngineDefs::EngineRestreamModel(const std::uint16_t modelId)
26012601
{
26022602
return g_pClientGame->RestreamModel(modelId);
26032603
}

Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CLuaEngineDefs : public CLuaDefs
9696
static eModelLoadState EngineStreamingGetModelLoadState(std::uint16_t modelId);
9797

9898
static void EnginePreloadWorldArea(CVector position, std::optional<PreloadAreaOption> option);
99-
static bool EngineRestreamModel(std::uint16_t modelId);
99+
static bool EngineRestreamModel(const std::uint16_t modelId);
100100
static bool EngineRestream(std::optional<RestreamOption> option);
101101

102102
private:

Client/sdk/core/CClientBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CClientBase
2424
virtual void PreHUDRenderExecutionHandler(bool bDidUnminimize, bool bDidRecreateRenderTargets) = 0;
2525
virtual void PostFrameExecutionHandler() = 0;
2626
virtual void IdleHandler() = 0;
27-
virtual void RestreamModel(unsigned short usModel) = 0;
27+
virtual void RestreamModel(const std::uint16_t model) = 0;
2828

2929
virtual bool WebsiteRequestResultHandler(const std::unordered_set<SString>& newPages) = 0;
3030

0 commit comments

Comments
 (0)