Skip to content

Commit 2d924c8

Browse files
committed
Fix for issue where incorrect skeleton was being exported for full model
1 parent b2fcbd4 commit 2d924c8

File tree

1 file changed

+11
-7
lines changed
  • xivModdingFramework/Models/DataContainers

1 file changed

+11
-7
lines changed

xivModdingFramework/Models/DataContainers/TTModel.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ public void SaveToFile(string filePath, Action<bool, string> loggingFunction = n
10931093
/// </summary>
10941094
/// <param name="filePath"></param>
10951095
/// <param name="loggingFunction"></param>
1096-
public void SaveFullToFile(string filePath, Action<bool, string> loggingFunction = null)
1096+
public void SaveFullToFile(string filePath, string raceId, Action<bool, string> loggingFunction = null)
10971097
{
10981098
if (loggingFunction == null)
10991099
{
@@ -1107,7 +1107,7 @@ public void SaveFullToFile(string filePath, Action<bool, string> loggingFunction
11071107
var connectionString = "Data Source=" + filePath + ";Pooling=False;";
11081108
try
11091109
{
1110-
var boneDict = ResolveBoneHeirarchy();
1110+
var boneDict = ResolveBoneHeirarchy(loggingFunction, raceId);
11111111

11121112
// Spawn a DB connection to do the raw queries.
11131113
// Using statements help ensure we don't accidentally leave any connections open and lock the file handle.
@@ -1501,7 +1501,7 @@ private float[] NewIdentityMatrix()
15011501
/// Used when saving the file to DB. (Or potentially animating it)
15021502
/// </summary>
15031503
/// <returns></returns>
1504-
private Dictionary<string, SkeletonData> ResolveBoneHeirarchy(Action<bool, string> loggingFunction = null)
1504+
private Dictionary<string, SkeletonData> ResolveBoneHeirarchy(Action<bool, string> loggingFunction = null, string raceId = "")
15051505
{
15061506
if (loggingFunction == null)
15071507
{
@@ -1511,13 +1511,17 @@ private Dictionary<string, SkeletonData> ResolveBoneHeirarchy(Action<bool, strin
15111511
var fullSkel = new Dictionary<string, SkeletonData>();
15121512
var skelDict = new Dictionary<string, SkeletonData>();
15131513

1514-
var skelName = Sklb.GetParsedSkelFilename(Source);
1515-
if(skelName == null)
1514+
var skelName = raceId;
1515+
1516+
if (string.IsNullOrEmpty(raceId))
15161517
{
1517-
return skelDict;
1518+
skelName = Sklb.GetParsedSkelFilename(Source);
1519+
if (skelName == null)
1520+
{
1521+
return skelDict;
1522+
}
15181523
}
15191524

1520-
15211525
var cwd = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
15221526
var skeletonFile = cwd + "/Skeletons/" + skelName + ".skel";
15231527
var skeletonData = File.ReadAllLines(skeletonFile);

0 commit comments

Comments
 (0)