fix error in character data generation when model is suddenly not present anymore
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
@@ -60,7 +61,16 @@ public class CharacterDataFactory
|
||||
return;
|
||||
}
|
||||
|
||||
var mdlPath = new Utf8String(mdl->ResourceHandle->FileName()).ToString();
|
||||
string mdlPath;
|
||||
try
|
||||
{
|
||||
mdlPath = new Utf8String(mdl->ResourceHandle->FileName()).ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.Warn("Could not get model data for " + objectKind);
|
||||
return;
|
||||
}
|
||||
PluginLog.Verbose("Adding File Replacement for Model " + mdlPath);
|
||||
|
||||
FileReplacement mdlFileReplacement = CreateFileReplacement(mdlPath);
|
||||
@@ -79,7 +89,18 @@ public class CharacterDataFactory
|
||||
|
||||
private unsafe void AddReplacementsFromMaterial(Material* mtrl, CharacterData cache, int inheritanceLevel = 0, string objectKind = "")
|
||||
{
|
||||
var fileName = new Utf8String(mtrl->ResourceHandle->FileName()).ToString();
|
||||
string fileName;
|
||||
try
|
||||
{
|
||||
fileName = new Utf8String(mtrl->ResourceHandle->FileName()).ToString();
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.Warn("Could not get material data for " + objectKind);
|
||||
return;
|
||||
}
|
||||
|
||||
PluginLog.Verbose("Adding File Replacement for Material " + fileName);
|
||||
var mtrlPath = fileName.Split("|")[2];
|
||||
|
||||
@@ -101,6 +122,8 @@ public class CharacterDataFactory
|
||||
|
||||
private void AddReplacementsFromTexture(string texPath, CharacterData cache, int inheritanceLevel = 0, string objectKind = "", bool doNotReverseResolve = true)
|
||||
{
|
||||
if (texPath.IsNullOrEmpty()) return;
|
||||
|
||||
PluginLog.Verbose("Adding File Replacement for Texture " + texPath);
|
||||
|
||||
var texFileReplacement = CreateFileReplacement(texPath, doNotReverseResolve);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.0.11.0</Version>
|
||||
<Version>0.0.12.0</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
||||
Reference in New Issue
Block a user