mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-26 10:24:14 +08:00
use the index argument to grab the preview URL from UGC query result, thanks to remelt from: viewtopic.php?p=2964432#p2964432
This commit is contained in:
parent
1c84f2c324
commit
555bafae0b
@ -227,8 +227,13 @@ bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STR
|
|||||||
//TODO: escape simulator tries downloading this url and unsubscribes if it fails
|
//TODO: escape simulator tries downloading this url and unsubscribes if it fails
|
||||||
|
|
||||||
auto request = std::find_if(ugc_queries.begin(), ugc_queries.end(), [&handle](struct UGC_query const& item) { return item.handle == handle; });
|
auto request = std::find_if(ugc_queries.begin(), ugc_queries.end(), [&handle](struct UGC_query const& item) { return item.handle == handle; });
|
||||||
if ((ugc_queries.end() != request) && !(index >= request->results.size())) {
|
if ((ugc_queries.end() != request) && (index < request->results.size())) {
|
||||||
|
// point at the beginning of the results
|
||||||
auto it = request->results.begin();
|
auto it = request->results.begin();
|
||||||
|
// then get the target result
|
||||||
|
//this is required for Escape Simulator to show the correct Preview Image, else it will be always the first
|
||||||
|
std::advance(it, index);
|
||||||
|
|
||||||
uint32 it2 = (uint32)*it;
|
uint32 it2 = (uint32)*it;
|
||||||
PRINT_DEBUG("Steam_UGC:GetQueryUGCPreviewURL: %u %s\n", it2, settings->getMod(it2).previewURL.c_str());
|
PRINT_DEBUG("Steam_UGC:GetQueryUGCPreviewURL: %u %s\n", it2, settings->getMod(it2).previewURL.c_str());
|
||||||
snprintf(pchURL, cchURLSize, "%s", settings->getMod(it2).previewURL.c_str());
|
snprintf(pchURL, cchURLSize, "%s", settings->getMod(it2).previewURL.c_str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user