Skip to content

Commit 844f7ba

Browse files
committed
- Fixed a file name check issue due to '.meta' including 'met' in the name.
1 parent c8a9e27 commit 844f7ba

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

xivModdingFramework/Models/FileTypes/Eqp.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,26 @@ public Eqp(DirectoryInfo gameDirectory)
112112

113113
public async Task SaveGimmickParameter(int equipmentId, GimmickParameter param)
114114
{
115+
if (equipmentId == 0)
116+
{
117+
throw new InvalidDataException("Cannot write GMP data for Set 0. (Use Set 1)");
118+
}
119+
115120
var data = await LoadGimmickParameterFile(false);
116121

117122
var offset = ResolveEqpEntryOffset(data, equipmentId);
118123

119124
if (offset == -1)
120125
{
121-
// Fug. Gotta write expansion function.
126+
// Expand the block, then get the offset.
127+
// (GMP files use an identical file structure to EQP files)
128+
data = ExpandEqpBlock(data, equipmentId);
129+
offset = ResolveEqpEntryOffset(data, equipmentId);
130+
131+
if(offset <= 0)
132+
{
133+
throw new InvalidDataException("Unable to resolve GMP data offset.");
134+
}
122135
}
123136

124137
IOUtil.ReplaceBytesAt(data, param.GetBytes(), offset);

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
199199
// If this is a slotless root, purge everything.
200200
await _modding.DeleteMod(mod.fullPath, false);
201201
}
202-
else if (allFiles.Contains(mod.fullPath) || mod.fullPath.Contains(Destination.Info.Slot))
202+
else if (allFiles.Contains(mod.fullPath) || mod.fullPath.Contains(Destination.Info.GetBaseFileName(true)))
203203
{
204204
// Otherwise, only purge the files we're replacing, and anything else that
205205
// contains our slot name.

0 commit comments

Comments
 (0)