Skip to content

Commit be7fece

Browse files
committed
Make engineRestreamModel return bool
1 parent f419fd6 commit be7fece

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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(std::uint16_t model)
6751+
bool CClientGame::RestreamModel(std::uint16_t model)
67526752
{
67536753
// Is this a vehicle ID?
67546754
if (CClientVehicleManager::IsValidModel(model))
@@ -6757,8 +6757,9 @@ void CClientGame::RestreamModel(std::uint16_t model)
67576757
// loaded when we do the restore. The streamer will
67586758
// eventually stream them back in with async loading.
67596759
m_pManager->GetVehicleManager()->RestreamVehicles(model);
6760-
}
67616760

6761+
return true;
6762+
}
67626763
// Is this an object ID?
67636764
else if (CClientObjectManager::IsValidModel(model))
67646765
{
@@ -6775,6 +6776,8 @@ void CClientGame::RestreamModel(std::uint16_t model)
67756776
// eventually stream them back in with async loading.
67766777
m_pManager->GetObjectManager()->RestreamObjects(model);
67776778
g_pGame->GetModelInfo(model)->RestreamIPL();
6779+
6780+
return true;
67786781
}
67796782
// Is this an ped ID?
67806783
else if (CClientPlayerManager::IsValidModel(model))
@@ -6783,12 +6786,16 @@ void CClientGame::RestreamModel(std::uint16_t model)
67836786
// loaded when we do the restore. The streamer will
67846787
// eventually stream them back in with async loading.
67856788
m_pManager->GetPedManager()->RestreamPeds(model);
6786-
}
6787-
else
67886789

6789-
// 'Restream' upgrades after model replacement to propagate visual changes with immediate effect
6790-
if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model))
6791-
m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model);
6790+
return true;
6791+
}
6792+
// 'Restream' upgrades after model replacement to propagate visual changes with immediate effect
6793+
else if (CClientObjectManager::IsValidModel(model) && CVehicleUpgrades::IsUpgrade(model))
6794+
{
6795+
m_pManager->GetVehicleManager()->RestreamVehicleUpgrades(model);
6796+
return true;
6797+
}
6798+
return false;
67926799
}
67936800

67946801
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(std::uint16_t model);
468+
bool RestreamModel(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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,9 +2597,9 @@ void CLuaEngineDefs::EnginePreloadWorldArea(CVector position, std::optional<Prel
25972597
g_pGame->GetStreaming()->LoadSceneCollision(&position);
25982598
}
25992599

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

26052605
void CLuaEngineDefs::EngineRestream(std::optional<RestreamOption> option)

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 void EngineRestreamModel(std::uint16_t modelId);
99+
static bool EngineRestreamModel(std::uint16_t modelId);
100100
static void EngineRestream(std::optional<RestreamOption> option);
101101

102102
private:

0 commit comments

Comments
 (0)