Skip to content

Commit 41d4306

Browse files
committed
fixed a bug where animated GIFs crashed the game and version bump
1 parent 08c85bf commit 41d4306

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ModelDownloader/HarmonyPatches/Patches/AnimatorControllerPatch.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ internal class AnimatorControllerPatch
1313
{
1414
private static void Prefix(AnimationControllerData __instance)
1515
{
16-
if (__instance.sprite.name.StartsWith("ModelDownloaderAnimation"))
16+
if (__instance != null && __instance.sprite != null && __instance.activeImages != null && __instance.sprite.name.StartsWith("ModelDownloaderAnimation"))
1717
{
1818
var newImageList = new List<Image>();
19-
20-
foreach (var activeImage in __instance.activeImages)
19+
for (int i = 0; i < __instance.activeImages.Count; i++)
2120
{
22-
if (__instance.sprites.Contains(activeImage.sprite)) newImageList.Add(activeImage);
21+
var activeImage = __instance.activeImages[i];
22+
if (activeImage && __instance.sprites.Contains(activeImage.sprite)) newImageList.Add(activeImage);
2323
}
2424
__instance.activeImages = newImageList;
2525
}

ModelDownloader/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.1.0")]
36-
[assembly: AssemblyFileVersion("1.1.0")]
35+
[assembly: AssemblyVersion("1.1.1")]
36+
[assembly: AssemblyFileVersion("1.1.1")]

ModelDownloader/Settings/UI/ModelDetailViewController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ internal void Initialize(ModelsaberEntry model, Sprite cover) {
123123

124124
DownloadInteractable = !DownloadUtils.CheckIfModelInstalled(model);
125125
PreviewInteractible = !DownloadUtils.CheckIfModelInstalled(model) && (model.Type != "platform" && model.Type != "avatar");
126-
Plugin.Log.Info(_pluginConfig.AutomaticallyGeneratePreviews.ToString());
126+
// Plugin.Log.Info(_pluginConfig.AutomaticallyGeneratePreviews.ToString());
127127
if (_pluginConfig.AutomaticallyGeneratePreviews && PreviewInteractible) PreviewPressed();
128128
}
129129

ModelDownloader/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "ModelDownloader",
44
"name": "ModelDownloader",
55
"author": "Bobbie",
6-
"version": "1.1.0",
6+
"version": "1.1.1",
77
"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.",
88
"gameVersion": "1.15.0",
99
"dependsOn": {

0 commit comments

Comments
 (0)