@@ -217,20 +217,33 @@ void CTFWorkshopMap::Steam_OnQueryUGCDetails( SteamUGCQueryCompleted_t *pResult,
217
217
}
218
218
219
219
uint32 state = steamUGC->GetItemState ( m_nFileID );
220
- if (( state & k_EItemStateNeedsUpdate ) ||
221
- !( state & ( k_EItemStateDownloading | k_EItemStateDownloadPending | k_EItemStateInstalled ) ) )
220
+ #ifdef BDSBASE
221
+ if (!(state & k_EItemStateDownloading))
222
+ #else
223
+ if ((state & k_EItemStateNeedsUpdate) ||
224
+ !(state & (k_EItemStateDownloading | k_EItemStateDownloadPending | k_EItemStateInstalled)) )
225
+ #endif
222
226
{
223
227
// Either out of date or not installed, downloading, or queued to download, ask UGC to do so. The latter happens
224
228
// for maps added not from subscriptions that have no reason for UGC to initiate downloads on its own.
229
+
230
+ // For some reason GetItemState returns stale data, the k_EItemStateNeedsUpdate flag is not set
231
+ // In the past this behaviour was already done for dedicated servers but not for clients, causing clients to be out-of-date when the map updated
232
+ // DownloadItem does an update check, no unnecessary downloads are done
225
233
if ( !steamUGC->DownloadItem ( m_nFileID, m_bHighPriority ) )
226
234
{
227
235
TFWorkshopWarning ( " DownloadItem failed for file, map will not be usable [ %s ]\n " , m_strCanonicalName.Get () );
228
236
return ;
229
237
}
230
238
231
- TFWorkshopMsg ( " New version available for map, download queued [ %s ]\n " , m_strCanonicalName.Get () );
239
+ #ifdef BDSBASE
240
+ TFWorkshopMsg (" Map update queued [ %s ]\n " , m_strCanonicalName.Get ());
241
+ #else
242
+ TFWorkshopMsg (" New version available for map, download queued [ %s ]\n " , m_strCanonicalName.Get ());
243
+ #endif
232
244
m_eState = eState_Downloading;
233
245
}
246
+ #ifndef BDSBASE
234
247
else if ( engine->IsDedicatedServer () &&
235
248
( state & k_EItemStateInstalled ) &&
236
249
!( state & k_EItemStateDownloading ) &&
@@ -254,8 +267,9 @@ void CTFWorkshopMap::Steam_OnQueryUGCDetails( SteamUGCQueryCompleted_t *pResult,
254
267
TFWorkshopMsg ( " Got updated information for map [ %s ]\n " , m_strCanonicalName.Get () );
255
268
m_eState = Downloaded () ? eState_Downloaded : eState_Downloading;
256
269
}
270
+ #endif
257
271
258
- // Notify gamerules of the udpate
272
+ // Notify gamerules of the update
259
273
TFGameRules ()->OnWorkshopMapUpdated ( m_nFileID );
260
274
}
261
275
0 commit comments