Skip to content

Commit

Permalink
[HaCreator] Fix issues loading maps with missing 'bg'
Browse files Browse the repository at this point in the history
  • Loading branch information
lastbattle committed Dec 22, 2020
1 parent 58422fa commit f78bbb2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions HaCreator/MapEditor/Info/BackgroundInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using HaCreator.MapEditor.Instance;
using HaCreator.Properties;
using HaCreator.Wz;
using MapleLib.Helpers;
using MapleLib.WzLib;
using MapleLib.WzLib.Spine;
using MapleLib.WzLib.WzProperties;
Expand Down Expand Up @@ -65,6 +66,13 @@ public static BackgroundInfo Get(GraphicsDevice graphicsDevice, string bS, Backg
WzImage bsImg = Program.InfoManager.BackgroundSets[bS];
WzImageProperty bgInfoProp = bsImg[type == BackgroundInfoType.Animation ? "ani" : type == BackgroundInfoType.Spine ? "spine" : "back"]?[no];

if (bgInfoProp == null)
{
string logError = string.Format("Background image {0}/{1} is null, {2}", bS, no, bsImg.ToString());
MapleLib.Helpers.ErrorLogger.Log(ErrorLevel.IncorrectStructure, logError);
return null;
}

if (type == BackgroundInfoType.Spine)
{
if (bgInfoProp.HCTagSpine == null)
Expand Down

0 comments on commit f78bbb2

Please sign in to comment.