Skip to content

Commit

Permalink
[HaCreator] Fix issues loading FriendsStory map with 'sitDir' 'offset…
Browse files Browse the repository at this point in the history
…' subproperty under 'map/seat'
  • Loading branch information
lastbattle committed Dec 22, 2020
1 parent 6597e53 commit 697f558
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions HaCreator/Wz/MapLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,19 @@ public static void LoadChairs(WzImage mapImage, Board mapBoard)
WzSubProperty chairParent = (WzSubProperty)mapImage["seat"];
if (chairParent != null)
{
foreach (WzVectorProperty chair in chairParent.WzProperties)
int i = 0;
WzImageProperty chairImage;
while ((chairImage = chairParent[i.ToString()]) != null)
{
mapBoard.BoardItems.Chairs.Add(new Chair(mapBoard, chair.X.Value, chair.Y.Value));
if (chairImage is WzVectorProperty chair)
{
mapBoard.BoardItems.Chairs.Add(new Chair(mapBoard, chair.X.Value, chair.Y.Value));
}

i++;
}
// Other WzSubProperty exist in maps like 330000100.img, FriendsStory
// 'sitDir' 'offset'
}
mapBoard.BoardItems.Chairs.Sort(new Comparison<Chair>(
delegate(Chair a, Chair b)
Expand Down

0 comments on commit 697f558

Please sign in to comment.