Skip to content

Commit

Permalink
[HaCreator] Fix null ref when simulating maps pre-big bang (tested ag…
Browse files Browse the repository at this point in the history
…ainst v83 GMS)
  • Loading branch information
lastbattle committed Dec 14, 2022
1 parent abb1ac8 commit f40773a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions HaCreator/MapSimulator/MapSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ protected override void LoadContent()
WzImage uiWindow1Image = (WzImage) Program.WzManager.FindWzImageByName("ui", "UIWindow.img"); //
WzImage uiWindow2Image = (WzImage) Program.WzManager.FindWzImageByName("ui", "UIWindow2.img"); // UI_004.wz

this.bBigBangUpdate = uiWindow2Image["BigBang!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"] != null; // different rendering for pre and post-bb, to support multiple vers
this.bBigBang2Update = uiWindow2Image["BigBang2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"] != null;
this.bBigBangUpdate = uiWindow2Image?["BigBang!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"] != null; // different rendering for pre and post-bb, to support multiple vers
this.bBigBang2Update = uiWindow2Image?["BigBang2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"] != null;

// BGM
if (Program.InfoManager.BGMs.ContainsKey(mapBoard.MapInfo.bgm))
Expand Down
2 changes: 1 addition & 1 deletion HaCreator/MapSimulator/MapSimulatorLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public static MinimapItem CreateMinimapFromProperty(WzImage uiWindow1Image, WzIm
if (mapBoard.MiniMap == null)
return null;

WzSubProperty minimapFrameProperty = (WzSubProperty)uiWindow2Image["MiniMap"];
WzSubProperty minimapFrameProperty = (WzSubProperty)uiWindow2Image?["MiniMap"];
if (minimapFrameProperty == null) // UIWindow2 not available pre-BB.
{
minimapFrameProperty = (WzSubProperty)uiWindow1Image["MiniMap"];
Expand Down

0 comments on commit f40773a

Please sign in to comment.