mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Prevent loading crashy shpks.
This commit is contained in:
parent
6b0b1629bd
commit
47268ab377
1 changed files with 14 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ public class PathResolver : IDisposable, IService
|
|||
ResourceCategory.GameScript => (null, ResolveData.Invalid),
|
||||
// Use actual resolving.
|
||||
ResourceCategory.Chara => Resolve(path, resourceType),
|
||||
ResourceCategory.Shader => Resolve(path, resourceType),
|
||||
ResourceCategory.Shader => ResolveShader(path, resourceType),
|
||||
ResourceCategory.Vfx => Resolve(path, resourceType),
|
||||
ResourceCategory.Sound => Resolve(path, resourceType),
|
||||
// EXD Modding in general should probably be prohibited but is currently used for fan translations.
|
||||
|
|
@ -83,6 +83,19 @@ public class PathResolver : IDisposable, IService
|
|||
};
|
||||
}
|
||||
|
||||
/// <remarks> Replacing the characterstockings.shpk or the characterocclusion.shpk files currently causes crashes, so we just entirely prevent that. </remarks>
|
||||
private (FullPath?, ResolveData) ResolveShader(Utf8GamePath gamePath, ResourceType type)
|
||||
{
|
||||
if (type is not ResourceType.Shpk)
|
||||
return Resolve(gamePath, type);
|
||||
|
||||
if (gamePath.Path.EndsWith("occlusion.shpk"u8)
|
||||
|| gamePath.Path.EndsWith("stockings.shpk"u8))
|
||||
return (null, ResolveData.Invalid);
|
||||
|
||||
return Resolve(gamePath, type);
|
||||
}
|
||||
|
||||
public (FullPath?, ResolveData) Resolve(Utf8GamePath gamePath, ResourceType type)
|
||||
{
|
||||
using var performance = _performance.Measure(PerformanceType.CharacterResolver);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue