Merge branch 'dev' into meeting-abilities

This commit is contained in:
Atony authored and GitHub committed 2026-08-24 21:48:54 -05:00
commit 0b1b223a6e
2 files changed
+12

No files matched your search

@@ -476,6 +476,10 @@ public static class RoleSettingMenuPatches
if (role.Configuration.CanModifyChance)
{
role.SetChance(roleSetting.RoleChance);
if (roleSetting.RoleChance == 0 && role.Configuration.MaxRoleCount != 0)
{
role.SetCount(0);
}
}
}
catch (Exception e)
+8
View File
@@ -128,6 +128,10 @@ public interface ICustomRole : IOptionable
if (presetConfig.TryGetEntry(ChanceConfigDefinition, out ConfigEntry<int> chanceEntry))
{
SetChance(chanceEntry.Value);
if (chanceEntry.Value == 0)
{
SetCount(0);
}
}
}
@@ -156,6 +160,10 @@ public interface ICustomRole : IOptionable
/// <returns>The role count option.</returns>
public virtual int? GetCount()
{
if (ParentMod.PluginConfig.TryGetEntry(ChanceConfigDefinition, out ConfigEntry<int> entry2) && entry2.Value == 0)
{
return 0;
}
if (ParentMod.PluginConfig.TryGetEntry(NumConfigDefinition, out ConfigEntry<int> entry))
{
return Mathf.Clamp(entry.Value, 0, Configuration.MaxRoleCount);