Fix GetFalloffExponent (maybe)

This commit is contained in:
Nick J. Connors 2021-12-30 00:30:28 -05:00
parent da11adfb26
commit 207c4cdce5

View File

@ -30,7 +30,10 @@ namespace NewHorizons.Utility
public static float GetFalloffExponent(this GravityVolume gv)
{
if (gv == null) return 0;
return (float)typeof(GravityVolume).GetField("_falloffExponent", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(gv);
if (gv._falloffType == GravityVolume.FalloffType.linear) return 1;
if (gv._falloffType == GravityVolume.FalloffType.inverseSquared) return 2;
return 0;
}
public static string ToCamelCase(this string str)