Skip to content

Commit

Permalink
fixed a bug where animated GIFs crashed the game and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
legoandmars committed May 29, 2021
1 parent 08c85bf commit 41d4306
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ internal class AnimatorControllerPatch
{
private static void Prefix(AnimationControllerData __instance)
{
if (__instance.sprite.name.StartsWith("ModelDownloaderAnimation"))
if (__instance != null && __instance.sprite != null && __instance.activeImages != null && __instance.sprite.name.StartsWith("ModelDownloaderAnimation"))
{
var newImageList = new List<Image>();

foreach (var activeImage in __instance.activeImages)
for (int i = 0; i < __instance.activeImages.Count; i++)
{
if (__instance.sprites.Contains(activeImage.sprite)) newImageList.Add(activeImage);
var activeImage = __instance.activeImages[i];
if (activeImage && __instance.sprites.Contains(activeImage.sprite)) newImageList.Add(activeImage);
}
__instance.activeImages = newImageList;
}
Expand Down
4 changes: 2 additions & 2 deletions ModelDownloader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: AssemblyVersion("1.1.1")]
[assembly: AssemblyFileVersion("1.1.1")]
2 changes: 1 addition & 1 deletion ModelDownloader/Settings/UI/ModelDetailViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ internal void Initialize(ModelsaberEntry model, Sprite cover) {

DownloadInteractable = !DownloadUtils.CheckIfModelInstalled(model);
PreviewInteractible = !DownloadUtils.CheckIfModelInstalled(model) && (model.Type != "platform" && model.Type != "avatar");
Plugin.Log.Info(_pluginConfig.AutomaticallyGeneratePreviews.ToString());
// Plugin.Log.Info(_pluginConfig.AutomaticallyGeneratePreviews.ToString());
if (_pluginConfig.AutomaticallyGeneratePreviews && PreviewInteractible) PreviewPressed();
}

Expand Down
2 changes: 1 addition & 1 deletion ModelDownloader/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "ModelDownloader",
"name": "ModelDownloader",
"author": "Bobbie",
"version": "1.1.0",
"version": "1.1.1",
"description": "A PC Beat Saber mod that allows you to download Sabers, Notes, Platforms, and Avatars directly from ModelSaber, all from a convenient window within your game.",
"gameVersion": "1.15.0",
"dependsOn": {
Expand Down

0 comments on commit 41d4306

Please sign in to comment.