Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Client/game_sa/CRenderWareSA.TextureReplacing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ bool CRenderWareSA::ModelInfoTXDAddTextures(SReplacementTextures* pReplacementTe
////////////////////////////////////////////////////////////////
void CRenderWareSA::ModelInfoTXDRemoveTextures(SReplacementTextures* pReplacementTextures)
{
// Force ped models to drop their loaded clump, mirroring the forced unload in GetModelTexturesInfo, so they pick up the restored textures below
for (ushort usModelId : pReplacementTextures->usedInModelIds)
{
CModelInfo* pModelInfo = pGame->GetModelInfo(usModelId);
if (pModelInfo && pModelInfo->GetModelType() == eModelInfoType::PED)
((void(__cdecl*)(unsigned short))FUNC_RemoveModel)(usModelId);
}

// For each using txd
for (uint i = 0; i < pReplacementTextures->perTxdList.size(); i++)
{
Expand Down
8 changes: 4 additions & 4 deletions Client/mods/deathmatch/logic/CClientPedManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ void CClientPedManager::RestreamPeds(unsigned short usModel)
{
pPed = *iter;

// Streamed in and same vehicle ID?
if (pPed->IsStreamedIn() && pPed->GetModel() == usModel)
// Streamed in (or the local player, whose m_bStreamedIn never gets set, see CLuaElementDefs::IsElementStreamedIn) and same model ID?
if ((pPed->IsStreamedIn() || pPed->IsLocalPlayer()) && pPed->GetModel() == usModel)
{
// Stream it out for a while until streamed decides to stream it
// back in eventually
Expand All @@ -128,8 +128,8 @@ void CClientPedManager::RestreamAllPeds()
{
for (auto& pPed : m_List)
{
// Streamed in and same vehicle ID?
if (pPed->IsStreamedIn())
// Streamed in (or the local player - see RestreamPeds above)?
if (pPed->IsStreamedIn() || pPed->IsLocalPlayer())
{
// Stream it out for a while until streamed decides to stream it
// back in eventually
Expand Down
Loading