Skip to content

Commit ba19dfd

Browse files
committed
Beta 2.3.3.3b
1 parent fba4c2d commit ba19dfd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4431,9 +4431,15 @@ public async Task<long> CopyModel(string originalPath, string newPath, string so
44314431
var xMdl = await GetRawMdlData(originalPath, false, offset);
44324432
var model = TTModel.FromRaw(xMdl);
44334433

4434+
if (model == null)
4435+
{
4436+
throw new InvalidDataException("Source model file does not exist.");
4437+
}
4438+
44344439
var originalRace = IOUtil.GetRaceFromPath(originalPath);
44354440
var newRace = IOUtil.GetRaceFromPath(newPath);
44364441

4442+
44374443
if(originalRace != newRace)
44384444
{
44394445
// Convert the model to the new race.

xivModdingFramework/Mods/FileTypes/TTMP.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ public async Task<int> CreateWizardModPack(ModPackData modPackData, IProgress<do
7171
var imageList = new HashSet<string>();
7272
var pageCount = 1;
7373

74+
Version version = modPackData.Version == null ? new Version(1, 0, 0, 0) : modPackData.Version;
7475
var modPackJson = new ModPackJson
7576
{
7677
TTMPVersion = _currentWizardTTMPVersion,
7778
MinimumFrameworkVersion = _minimumAssembly,
7879
Name = modPackData.Name,
7980
Author = modPackData.Author,
80-
Version = modPackData.Version.ToString(),
81+
Version = version.ToString(),
8182
Description = modPackData.Description,
8283
Url = modPackData.Url,
8384
ModPackPages = new List<ModPackPageJson>()
@@ -117,11 +118,12 @@ public async Task<int> CreateWizardModPack(ModPackData modPackData, IProgress<do
117118
imageList.Add(imageFileName);
118119
}
119120

121+
var fn = imageFileName == "" ? "" : "images/" + Path.GetFileName(imageFileName);
120122
var modOptionJson = new ModOptionJson
121123
{
122124
Name = modOption.Name,
123125
Description = modOption.Description,
124-
ImagePath = "images/" + Path.GetFileName(imageFileName),
126+
ImagePath = fn,
125127
GroupName = modOption.GroupName,
126128
SelectionType = modOption.SelectionType,
127129
IsChecked=modOption.IsChecked,

0 commit comments

Comments
 (0)