Skip to content

Commit 7bd79ce

Browse files
committed
Update v2.3.4.10
2 parents 872329d + 89ff203 commit 7bd79ce

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public async Task<XivMdl> GetRawMdlData(string mdlPath, bool getOriginal = false
444444
return null;
445445
}
446446

447-
var mdlData = await dat.GetType3Data(offset, _dataFile);
447+
var mdlData = await dat.GetType3Data(offset, IOUtil.GetDataFileFromPath(mdlPath));
448448

449449
var xivMdl = new XivMdl { MdlPath = mdlPath };
450450
int totalNonNullMaterials = 0;

xivModdingFramework/SqPack/FileTypes/Dat.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public int CreateNewDat(XivDataFile dataFile, bool alreadyLocked = false)
129129
}
130130

131131
var index = new Index(_gameDirectory);
132-
index.UpdateIndexDatCount(dataFile, nextDatNumber);
132+
index.UpdateIndexDatCount(dataFile, nextDatNumber, alreadyLocked);
133133

134134
return nextDatNumber;
135135
}
@@ -1377,7 +1377,7 @@ private async Task<int> GetFirstDatWithSpace(XivDataFile dataFile, int fileSize
13771377
targetDat = i;
13781378
break;
13791379
}
1380-
1380+
//sound/battle/enpc/se_enpc_alchemist_goblin_a.scd
13811381
// Didn't find a DAT file with space, gotta create a new one.
13821382
if (targetDat < 0)
13831383
{
@@ -1865,7 +1865,7 @@ public static async Task<Dictionary<long, long>> ComputeOpenSlots(XivDataFile df
18651865
var slots = new Dictionary<long, long>();
18661866
var modlist = await _modding.GetModListAsync();
18671867

1868-
var modsByFile = modlist.Mods.Where(x => !String.IsNullOrWhiteSpace(x.fullPath)).GroupBy(x => {
1868+
var modsByFile = modlist.Mods.Where(x => !String.IsNullOrWhiteSpace(x.fullPath) && x.datFile == df.GetDataFileName()).GroupBy(x => {
18691869
long offset = x.data.modOffset;
18701870
var rawOffset = offset / 8;
18711871
var datNum = (rawOffset & 0xF) >> 1;

xivModdingFramework/SqPack/FileTypes/Index.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ public void UpdateIndexDatCount(XivDataFile dataFile, int datNum, bool alreadySe
6262
Path.Combine(_gameDirectory.FullName, $"{dataFile.GetDataFileName()}{Index2Extension}")
6363
};
6464

65-
foreach (var indexPath in indexPaths)
65+
if (!alreadySemaphoreLocked)
6666
{
67-
if (!alreadySemaphoreLocked)
68-
{
69-
_semaphoreSlim.Wait();
70-
}
71-
try
67+
_semaphoreSlim.Wait();
68+
}
69+
try
70+
{
71+
foreach (var indexPath in indexPaths)
7272
{
7373
using (var bw = new BinaryWriter(File.OpenWrite(indexPath)))
7474
{
7575
bw.BaseStream.Seek(1104, SeekOrigin.Begin);
7676
bw.Write(datCount);
7777
}
7878
}
79-
finally
79+
}
80+
finally
81+
{
82+
if (!alreadySemaphoreLocked)
8083
{
81-
if (!alreadySemaphoreLocked)
82-
{
83-
_semaphoreSlim.Release();
84-
}
84+
_semaphoreSlim.Release();
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)