23 lines
564 B
C#
23 lines
564 B
C#
namespace Harmony.GamePrefsPatches
|
|
{
|
|
[HarmonyPatch(typeof(GamePrefs))]
|
|
[HarmonyPatch("SetObjectInternal")]
|
|
public class SetObjectInternalPatch
|
|
{
|
|
public static bool Prefix(GamePrefs __instance, EnumGamePrefs _eProperty, object _value,
|
|
object[] ___propertyValues
|
|
)
|
|
{
|
|
int num = (int)_eProperty;
|
|
|
|
if (num >= ___propertyValues.Length)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
}
|