Skip to content

[TF2] fix: client not updating workshop maps #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
15 changes: 3 additions & 12 deletions src/game/server/tf/workshop/maps_workshop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ CTFMapsWorkshop::CTFMapsWorkshop()
, m_callbackDownloadItem_GameServer( NULL, NULL )
, m_callbackItemInstalled_GameServer( NULL, NULL )
, m_mapMaps( 0, 0, PublishedFileId_t_Less )
, m_nPreparingMap( k_PublishedFileIdInvalid )
{
}

Expand Down Expand Up @@ -542,12 +541,9 @@ CTFMapsWorkshop::AsyncPrepareLevelResources( /* in/out */ char *pMapName, size_t
{
*flProgress = 1.f;
}
m_nPreparingMap = k_PublishedFileIdInvalid;
return IServerGameDLL::ePrepareLevelResources_Prepared;
}

bool bNewPrepare = ( m_nPreparingMap != nMapID );
m_nPreparingMap = nMapID;

TFWorkshopDebug( "OnClientPrepareLevelResources for [ %s ]\n", pMapName );

Expand All @@ -564,11 +560,8 @@ CTFMapsWorkshop::AsyncPrepareLevelResources( /* in/out */ char *pMapName, size_t
pMap = m_mapMaps[ nIndex ];
}

if ( bNewPrepare )
{
// Even if map is up to date, it could be stale, so always start a new prepare with a re-check
pMap->Refresh( CTFWorkshopMap::eRefresh_HighPriority );
}
// Even if map is up to date, it could be stale, so always start a new prepare with a re-check
pMap->Refresh( CTFWorkshopMap::eRefresh_HighPriority );

if ( pMap->State() == CTFWorkshopMap::eState_Refreshing )
{
Expand Down Expand Up @@ -618,8 +611,6 @@ CTFMapsWorkshop::AsyncPrepareLevelResources( /* in/out */ char *pMapName, size_t
*flProgress = 1.f;
}

// New calls to this map ID are new loads
m_nPreparingMap = k_PublishedFileIdInvalid;

return IServerGameDLL::ePrepareLevelResources_Prepared;
}
Expand Down Expand Up @@ -790,7 +781,7 @@ bool CTFMapsWorkshop::GetWorkshopMapDesc( uint32 uIndex, WorkshopMapDesc_t* pDes
V_sprintf_safe( pDesc->szMapName, "workshop/%llu", id );
pDesc->uTimestamp = 0;
pDesc->bDownloaded = false;

auto index = m_mapMaps.Find( id );
if ( index != m_mapMaps.InvalidIndex() )
{
Expand Down
2 changes: 0 additions & 2 deletions src/game/server/tf/workshop/maps_workshop.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ class CTFMapsWorkshop : public CAutoGameSystemPerFrame
// All managed workshop maps
CUtlMap< PublishedFileId_t, CTFWorkshopMap * > m_mapMaps;
CUtlVector< PublishedFileId_t > m_vecSubscribedMaps;

PublishedFileId_t m_nPreparingMap;
};

//
Expand Down