fix mounts

This commit is contained in:
Stanley Dimant
2022-08-25 20:36:21 +02:00
parent 4e2d371f10
commit 1d6d390dd6
3 changed files with 18 additions and 11 deletions

View File

@@ -235,7 +235,7 @@ public class CachedPlayer
RequestedPenumbraRedraw = true; RequestedPenumbraRedraw = true;
Logger.Debug( Logger.Debug(
$"Request Redraw for {PlayerName}"); $"Request Redraw for {PlayerName}");
if (_ipcManager.CheckGlamourerApi()) if (_ipcManager.CheckGlamourerApi() && !string.IsNullOrEmpty(glamourerData))
{ {
_ipcManager.GlamourerApplyAll(glamourerData, PlayerCharacter.Address); _ipcManager.GlamourerApplyAll(glamourerData, PlayerCharacter.Address);
} }
@@ -250,7 +250,7 @@ public class CachedPlayer
if (minionOrMount != null) if (minionOrMount != null)
{ {
Logger.Debug($"Request Redraw for Minion/Mount"); Logger.Debug($"Request Redraw for Minion/Mount");
if (_ipcManager.CheckGlamourerApi()) if (_ipcManager.CheckGlamourerApi() && !string.IsNullOrEmpty(glamourerData))
{ {
_ipcManager.GlamourerApplyAll(glamourerData, obj: (IntPtr)minionOrMount); _ipcManager.GlamourerApplyAll(glamourerData, obj: (IntPtr)minionOrMount);
} }
@@ -266,7 +266,7 @@ public class CachedPlayer
if (pet != IntPtr.Zero) if (pet != IntPtr.Zero)
{ {
Logger.Debug("Request Redraw for Pet"); Logger.Debug("Request Redraw for Pet");
if (_ipcManager.CheckGlamourerApi()) if (_ipcManager.CheckGlamourerApi() && !string.IsNullOrEmpty(glamourerData))
{ {
_ipcManager.GlamourerApplyAll(glamourerData, pet); _ipcManager.GlamourerApplyAll(glamourerData, pet);
} }
@@ -282,7 +282,7 @@ public class CachedPlayer
if (companion != IntPtr.Zero) if (companion != IntPtr.Zero)
{ {
Logger.Debug("Request Redraw for Companion"); Logger.Debug("Request Redraw for Companion");
if (_ipcManager.CheckGlamourerApi()) if (_ipcManager.CheckGlamourerApi() && !string.IsNullOrEmpty(glamourerData))
{ {
_ipcManager.GlamourerApplyAll(glamourerData, companion); _ipcManager.GlamourerApplyAll(glamourerData, companion);
} }

View File

@@ -143,6 +143,8 @@ namespace MareSynchronos.Managers
public string GlamourerGetCharacterCustomization(GameObject character) public string GlamourerGetCharacterCustomization(GameObject character)
{ {
if (!CheckGlamourerApi()) return string.Empty; if (!CheckGlamourerApi()) return string.Empty;
try
{
var glamourerString = _glamourerGetAllCustomization!.InvokeFunc(character); var glamourerString = _glamourerGetAllCustomization!.InvokeFunc(character);
byte[] bytes = Convert.FromBase64String(glamourerString); byte[] bytes = Convert.FromBase64String(glamourerString);
// ignore transparency // ignore transparency
@@ -150,6 +152,11 @@ namespace MareSynchronos.Managers
bytes[89] = 63; bytes[89] = 63;
return Convert.ToBase64String(bytes); return Convert.ToBase64String(bytes);
} }
catch
{
return string.Empty;
}
}
public void GlamourerRevertCharacterCustomization(GameObject character) public void GlamourerRevertCharacterCustomization(GameObject character)
{ {

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>0.3.6</Version> <Version>0.3.7</Version>
<Description></Description> <Description></Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl> <PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>