mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 05:43:42 +01:00
Maybe fix migration for metadata containing mods, also fix negative values in mod collection settings causing problems.
This commit is contained in:
parent
7409d0bc2f
commit
3b2876a6e4
3 changed files with 15 additions and 5 deletions
|
|
@ -149,7 +149,7 @@ public class ModSettings
|
|||
// A simple struct conversion to easily save settings by name instead of value.
|
||||
public struct SavedSettings
|
||||
{
|
||||
public Dictionary< string, uint > Settings;
|
||||
public Dictionary< string, long > Settings;
|
||||
public int Priority;
|
||||
public bool Enabled;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public class ModSettings
|
|||
{
|
||||
Priority = settings.Priority;
|
||||
Enabled = settings.Enabled;
|
||||
Settings = new Dictionary< string, uint >( mod.Groups.Count );
|
||||
Settings = new Dictionary< string, long >( mod.Groups.Count );
|
||||
settings.AddMissingSettings( mod.Groups.Count );
|
||||
|
||||
foreach( var (group, setting) in mod.Groups.Zip( settings.Settings ) )
|
||||
|
|
@ -183,7 +183,8 @@ public class ModSettings
|
|||
{
|
||||
if( Settings.TryGetValue( group.Name, out var config ) )
|
||||
{
|
||||
var actualConfig = FixSetting( group, config );
|
||||
var castConfig = ( uint )Math.Clamp( config, 0, uint.MaxValue );
|
||||
var actualConfig = FixSetting( group, castConfig );
|
||||
list.Add( actualConfig );
|
||||
if( actualConfig != config )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue