mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Don't send AAS while switching avatar.
Don't send AAS while switching avatar. This should mean I am less likely to load into the wrong states while switching if others load me faster. This does mean though that it is more likely that remote users will apply null buffers forcing all 0/false instead of garbage aas, but its at least kind of a mitigation. There is a possibility syncing garbage data is better than syncing nothing at all, as that does give the chance to apply settings that don't immediatly load in naked. This just requires testing...
This commit is contained in:
parent
495a3b33fd
commit
9332b06d06
6 changed files with 69 additions and 52 deletions
|
@ -39,7 +39,7 @@ internal class HarmonyPatches
|
|||
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
|
||||
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
|
||||
{
|
||||
externalBuffer.OnApplyAAS(settingsFloat, settingsInt, settingsByte);
|
||||
externalBuffer.OnReceiveAAS(settingsFloat, settingsInt, settingsByte);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -47,7 +47,7 @@ internal class HarmonyPatches
|
|||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CVRAnimatorManager), "ApplyAdvancedAvatarSettingsFromBuffer")]
|
||||
private static bool Prefix_PuppetMaster_ApplyAdvancedAvatarSettingsFromBuffer(ref Animator ____animator)
|
||||
private static bool Prefix_CVRAnimatorManager_ApplyAdvancedAvatarSettingsFromBuffer(ref Animator ____animator)
|
||||
{
|
||||
AASBufferHelper externalBuffer = ____animator.GetComponentInParent<AASBufferHelper>();
|
||||
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
|
||||
|
@ -57,4 +57,13 @@ internal class HarmonyPatches
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), "SendAdvancedAvatarSettings")]
|
||||
private static bool Prefix_PlayerSetup_SendAdvancedAvatarSettings(ref PlayerSetup __instance)
|
||||
{
|
||||
//dont sync wrong settings to remote users
|
||||
if (__instance.avatarIsLoading) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue