Skip to content

Commit

Permalink
Squashed some bugs when loading skills
Browse files Browse the repository at this point in the history
- Certain skills that use a link property (inlink, outlink and UOL) don't have images ( #2 )
- Code formatting and clean-up (inevitiable while i was debugging, inline brackets ftw)

I spent so long trying to figure out why sub-properties for skills were being cleared... It's because I was clearing them thinking MapleLib was returning a new array every time
  • Loading branch information
izarooni committed Jun 26, 2020
1 parent 6bcd092 commit e24970e
Show file tree
Hide file tree
Showing 12 changed files with 1,052 additions and 1,337 deletions.
2 changes: 1 addition & 1 deletion MapleLib/WzLib/Util/WzTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static double GetDecryptionSuccessRate(string wzPath, WzMapleVersion encV
else
wzf = new WzFile(wzPath, (short)version, encVersion);
wzf.ParseWzFile();
if (version == null) version = wzf.Version;
if (version == null) version = wzf.FileVersion;
int recognizedChars = 0;
int totalChars = 0;
foreach (WzDirectory wzdir in wzf.WzDirectory.WzDirectories)
Expand Down
16 changes: 10 additions & 6 deletions MapleLib/WzLib/WzDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ public override /*I*/WzFile WzFileParent
get { return wzFile; }
}

/// <summary>
/// Disposes the obejct
/// </summary>
public override void Dispose()
public override string ToString() {
return string.Format("WzDirectory('{0}')", Name);
}

/// <summary>
/// Disposes the obejct
/// </summary>
public override void Dispose()
{
name = null;
reader = null;
Expand Down Expand Up @@ -107,12 +111,12 @@ public override void Dispose()
get
{
foreach (WzImage i in images)
if (i.Name.ToLower() == name.ToLower())
if (i.Name.ToLower() == name.ToLower()
|| Path.GetFileNameWithoutExtension(i.Name.ToLower()) == Path.GetFileNameWithoutExtension(name.ToLower()))
return i;
foreach (WzDirectory d in subDirs)
if (d.Name.ToLower() == name.ToLower())
return d;
//throw new KeyNotFoundException("No wz image or directory was found with the specified name");
return null;
}
set
Expand Down
Loading

0 comments on commit e24970e

Please sign in to comment.