mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[AASBufferFix] Fix issue allowing AASBufferFix to count past AAS bit limit.
I have never seen an avatar over this limit until today...
This commit is contained in:
parent
8d4f17b8d1
commit
37875a2c7c
1 changed files with 9 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
using UnityEngine;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AASBufferFix;
|
||||
|
||||
|
@ -9,22 +10,26 @@ public class Utils
|
|||
int avatarFloatCount = 0;
|
||||
int avatarIntCount = 0;
|
||||
int avatarBoolCount = 0;
|
||||
int bitCount = 0;
|
||||
|
||||
foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
|
||||
{
|
||||
if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name))
|
||||
if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name) && bitCount <= 3200)
|
||||
{
|
||||
AnimatorControllerParameterType type = animatorControllerParameter.type;
|
||||
switch (type)
|
||||
{
|
||||
case AnimatorControllerParameterType.Float:
|
||||
avatarFloatCount++;
|
||||
bitCount += 32;
|
||||
break;
|
||||
case AnimatorControllerParameterType.Int:
|
||||
avatarIntCount++;
|
||||
bitCount += 32;
|
||||
break;
|
||||
case AnimatorControllerParameterType.Bool:
|
||||
avatarBoolCount++;
|
||||
bitCount++;
|
||||
break;
|
||||
default:
|
||||
//we dont count triggers
|
||||
|
@ -37,10 +42,11 @@ public class Utils
|
|||
avatarBoolCount = ((int)Math.Ceiling((double)avatarBoolCount / 8));
|
||||
|
||||
//create the footprint
|
||||
|
||||
return (avatarFloatCount + 1) * (avatarIntCount + 1) * (avatarBoolCount + 1);
|
||||
}
|
||||
|
||||
private static HashSet<string> coreParameters = new HashSet<string>
|
||||
private static readonly HashSet<string> coreParameters = new HashSet<string>
|
||||
{
|
||||
"MovementX",
|
||||
"MovementY",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue