mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +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;
|
namespace NAK.AASBufferFix;
|
||||||
|
|
||||||
|
@ -9,22 +10,26 @@ public class Utils
|
||||||
int avatarFloatCount = 0;
|
int avatarFloatCount = 0;
|
||||||
int avatarIntCount = 0;
|
int avatarIntCount = 0;
|
||||||
int avatarBoolCount = 0;
|
int avatarBoolCount = 0;
|
||||||
|
int bitCount = 0;
|
||||||
|
|
||||||
foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
|
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;
|
AnimatorControllerParameterType type = animatorControllerParameter.type;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case AnimatorControllerParameterType.Float:
|
case AnimatorControllerParameterType.Float:
|
||||||
avatarFloatCount++;
|
avatarFloatCount++;
|
||||||
|
bitCount += 32;
|
||||||
break;
|
break;
|
||||||
case AnimatorControllerParameterType.Int:
|
case AnimatorControllerParameterType.Int:
|
||||||
avatarIntCount++;
|
avatarIntCount++;
|
||||||
|
bitCount += 32;
|
||||||
break;
|
break;
|
||||||
case AnimatorControllerParameterType.Bool:
|
case AnimatorControllerParameterType.Bool:
|
||||||
avatarBoolCount++;
|
avatarBoolCount++;
|
||||||
|
bitCount++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//we dont count triggers
|
//we dont count triggers
|
||||||
|
@ -37,10 +42,11 @@ public class Utils
|
||||||
avatarBoolCount = ((int)Math.Ceiling((double)avatarBoolCount / 8));
|
avatarBoolCount = ((int)Math.Ceiling((double)avatarBoolCount / 8));
|
||||||
|
|
||||||
//create the footprint
|
//create the footprint
|
||||||
|
|
||||||
return (avatarFloatCount + 1) * (avatarIntCount + 1) * (avatarBoolCount + 1);
|
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",
|
"MovementX",
|
||||||
"MovementY",
|
"MovementY",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue