Skip to content

Commit

Permalink
Fix get verb not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwindalmir committed Sep 18, 2021
1 parent a60fe69 commit 7e4de01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WorkshopToolCommon/GameBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,13 @@ static System.Threading.Tasks.Task<bool> DownloadMods(ProcessedOptions options)
MySandboxGame.Log.WriteLineAndConsole("Beginning batch workshop download...");
MySandboxGame.Log.WriteLineAndConsole(string.Empty);
if (options.Collections?.Count() > 0)
if (options.Collections?.Count() > 0 || options.Ids?.Count() > 0)
{
var items = new List<MyWorkshopItem>();
// get collection information
options.Collections.ForEach(i => items.AddRange(WorkshopHelper.GetCollectionDetails(i)));
WorkshopHelper.GetItemsBlocking(options.Ids).ForEach(item =>
options.Collections?.ForEach(i => items.AddRange(WorkshopHelper.GetCollectionDetails(i)));
WorkshopHelper.GetItemsBlocking(options?.Ids)?.ForEach(item =>
{
// Ids can contain any workshop id, including collections, so check each one
if (item.ItemType == MyWorkshopItemType.Collection)
Expand Down Expand Up @@ -1007,7 +1007,7 @@ static string[] CombineCollectionWithList(WorkshopType type, List<MyWorkshopItem

return tempList.ToArray();
}
return existingitems.ToArray();
return existingitems?.ToArray();
}

public static void CopyAll(string source, string target)
Expand Down
2 changes: 2 additions & 0 deletions WorkshopToolCommon/WorkshopHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public static MyWorkshopItem GetItemBlocking(ulong id)

public static List<MyWorkshopItem> GetItemsBlocking(ICollection<ulong> ids)
{
if (ids == null)
return null;
#if SE
var workshopIds = new List<WorkshopId>();
ids.ForEach(i => workshopIds.Add(new WorkshopId(i, MyGameService.GetDefaultUGC().ServiceName)));
Expand Down

0 comments on commit 7e4de01

Please sign in to comment.