@@ -350,18 +350,19 @@ private static void ValidateOption(PmpStandardOptionJson op)
350
350
var selected = group . DefaultSettings ;
351
351
352
352
// If the user selected custom settings, use those.
353
- if ( group . SelectedSettings >= 0 )
353
+ if ( group . SelectedSettings . HasValue )
354
354
{
355
- selected = group . SelectedSettings ;
355
+ selected = group . SelectedSettings . Value ;
356
356
}
357
357
358
358
if ( group . Type == "Single" )
359
359
{
360
- if ( selected < 0 || selected >= group . Options . Count )
360
+ var selectedIdx = ( int ) selected ;
361
+ if ( selected < 0 || selectedIdx >= group . Options . Count )
361
362
{
362
363
selected = 0 ;
363
364
}
364
- var groupRes = await ImportOption ( group . Options [ selected ] , unzippedPath , tx , progress , groupIdx , optionIdx ) ;
365
+ var groupRes = await ImportOption ( group . Options [ selectedIdx ] , unzippedPath , tx , progress , groupIdx , optionIdx ) ;
365
366
UnionDict ( imported , groupRes . Imported ) ;
366
367
notImported . UnionWith ( groupRes . NotImported ) ;
367
368
}
@@ -373,7 +374,7 @@ private static void ValidateOption(PmpStandardOptionJson op)
373
374
foreach ( var op in ordered )
374
375
{
375
376
var i = group . Options . IndexOf ( op ) ;
376
- var value = 1 << i ;
377
+ var value = 1UL << i ;
377
378
if ( ( selected & value ) > 0 )
378
379
{
379
380
var groupRes = await ImportOption ( group . Options [ i ] , unzippedPath , tx , progress , groupIdx , optionIdx ) ;
@@ -393,7 +394,7 @@ private static void ValidateOption(PmpStandardOptionJson op)
393
394
// Bitmask options.
394
395
for ( int i = 0 ; i < group . Options . Count ; i ++ )
395
396
{
396
- var value = 1 << i ;
397
+ var value = 1UL << i ;
397
398
if ( ( selected & value ) > 0 )
398
399
{
399
400
var disableOpt = group . Options [ i ] as PmpDisableImcOptionJson ;
@@ -1334,10 +1335,10 @@ public class PMPGroupJson
1334
1335
public string Type = "" ;
1335
1336
1336
1337
// Only used internally when the user is selecting options during install/application.
1337
- [ JsonIgnore ] public int SelectedSettings = - 1 ;
1338
+ [ JsonIgnore ] public ulong ? SelectedSettings = null ;
1338
1339
1339
1340
// Either single Index or Bitflag.
1340
- public int DefaultSettings ;
1341
+ public ulong DefaultSettings ;
1341
1342
1342
1343
public List < PMPOptionJson > Options = new List < PMPOptionJson > ( ) ;
1343
1344
}
0 commit comments