mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Revert "Set role amount to 0 if chance is 0"
This reverts commit 794c762949.
This commit is contained in:
1 parent
f064952aa6
commit
709b59300b
2 files changed
-12
No files matched your search
@@ -472,10 +472,6 @@ public static class RoleSettingMenuPatches
|
|||||||
if (role.Configuration.CanModifyChance)
|
if (role.Configuration.CanModifyChance)
|
||||||
{
|
{
|
||||||
role.SetChance(roleSetting.RoleChance);
|
role.SetChance(roleSetting.RoleChance);
|
||||||
if (roleSetting.RoleChance == 0 && role.Configuration.MaxRoleCount != 0)
|
|
||||||
{
|
|
||||||
role.SetCount(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@@ -164,10 +164,6 @@ public interface ICustomRole : IOptionable
|
|||||||
if (presetConfig.TryGetEntry(ChanceConfigDefinition, out ConfigEntry<int> chanceEntry))
|
if (presetConfig.TryGetEntry(ChanceConfigDefinition, out ConfigEntry<int> chanceEntry))
|
||||||
{
|
{
|
||||||
SetChance(chanceEntry.Value);
|
SetChance(chanceEntry.Value);
|
||||||
if (chanceEntry.Value == 0)
|
|
||||||
{
|
|
||||||
SetCount(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,10 +192,6 @@ public interface ICustomRole : IOptionable
|
|||||||
/// <returns>The role count option.</returns>
|
/// <returns>The role count option.</returns>
|
||||||
public virtual int? GetCount()
|
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))
|
if (ParentMod.PluginConfig.TryGetEntry(NumConfigDefinition, out ConfigEntry<int> entry))
|
||||||
{
|
{
|
||||||
return Mathf.Clamp(entry.Value, 0, Configuration.MaxRoleCount);
|
return Mathf.Clamp(entry.Value, 0, Configuration.MaxRoleCount);
|
||||||
|
|||||||
Reference in new issue
Block a user