Skip to content

Commit e24970e

Browse files
committed
Squashed some bugs when loading skills
- 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
1 parent 6bcd092 commit e24970e

File tree

12 files changed

+1052
-1337
lines changed

12 files changed

+1052
-1337
lines changed

MapleLib/WzLib/Util/WzTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static double GetDecryptionSuccessRate(string wzPath, WzMapleVersion encV
114114
else
115115
wzf = new WzFile(wzPath, (short)version, encVersion);
116116
wzf.ParseWzFile();
117-
if (version == null) version = wzf.Version;
117+
if (version == null) version = wzf.FileVersion;
118118
int recognizedChars = 0;
119119
int totalChars = 0;
120120
foreach (WzDirectory wzdir in wzf.WzDirectory.WzDirectories)

MapleLib/WzLib/WzDirectory.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ public override /*I*/WzFile WzFileParent
5858
get { return wzFile; }
5959
}
6060

61-
/// <summary>
62-
/// Disposes the obejct
63-
/// </summary>
64-
public override void Dispose()
61+
public override string ToString() {
62+
return string.Format("WzDirectory('{0}')", Name);
63+
}
64+
65+
/// <summary>
66+
/// Disposes the obejct
67+
/// </summary>
68+
public override void Dispose()
6569
{
6670
name = null;
6771
reader = null;
@@ -107,12 +111,12 @@ public override void Dispose()
107111
get
108112
{
109113
foreach (WzImage i in images)
110-
if (i.Name.ToLower() == name.ToLower())
114+
if (i.Name.ToLower() == name.ToLower()
115+
|| Path.GetFileNameWithoutExtension(i.Name.ToLower()) == Path.GetFileNameWithoutExtension(name.ToLower()))
111116
return i;
112117
foreach (WzDirectory d in subDirs)
113118
if (d.Name.ToLower() == name.ToLower())
114119
return d;
115-
//throw new KeyNotFoundException("No wz image or directory was found with the specified name");
116120
return null;
117121
}
118122
set

0 commit comments

Comments
 (0)