Compare commits

..

1 Commits

Author SHA1 Message Date
ivan tkachenko 766e393a58 Add LethalConfig with suitable custom options
The custom callback attempts to prevent modifications mid-round. Use
IsHost to check for permissions, as IsClient is always true for
everyone even in local single-player setting.

There is a bug in LethalConfig which makes it possible to modify entries
bypassing the callback once per round, but it is pretty hard to abuse:
https://github.com/AinaVT/LethalConfig/issues/60
2025-07-12 16:56:58 +03:00
1 changed files with 2 additions and 2 deletions

View File

@ -307,7 +307,7 @@ namespace MuzikaGromche
var slider = new IntSliderConfigItem(track.Weight.Entry, new IntSliderOptions var slider = new IntSliderConfigItem(track.Weight.Entry, new IntSliderOptions
{ {
RequiresRestart = false, RequiresRestart = false,
CanModifyCallback = CanModifyCallback, CanModifyCallback = CanModifyWeightsNow,
}); });
LethalConfigManager.AddConfigItem(slider); LethalConfigManager.AddConfigItem(slider);
} }
@ -323,7 +323,7 @@ namespace MuzikaGromche
ConfigManager.Register(this); ConfigManager.Register(this);
} }
public static CanModifyResult CanModifyCallback() public static CanModifyResult CanModifyWeightsNow()
{ {
var startOfRound = StartOfRound.Instance; var startOfRound = StartOfRound.Instance;
if (!startOfRound) if (!startOfRound)