diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.cs b/VPet-Simulator.Core/Graph/PNGAnimation.cs index d7e6aa4..1d77317 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.cs @@ -85,6 +85,15 @@ namespace VPet_Simulator.Core return; } var paths = p.GetFiles("*.png"); + if (paths.Length == 0) + { + return; + } + else if (paths.Length == 1) + { + Picture.LoadGraph(graph, paths[0], info); + return; + } bool isLoop = info[(gbol)"loop"]; PNGAnimation pa = new PNGAnimation(graph, path.FullName, paths, new GraphInfo(path, info), isLoop); diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index c7c5c6e..6cbecfc 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -45,6 +45,8 @@ namespace VPet_Simulator.Core PNGAnimation.LoadGraph(graph, path, info); return; } + if (path.Extension != ".png") + return; int length = info.GetInt("length"); if (length == 0) {