@@ -82,7 +82,7 @@ void TryPickupItemFromCollider(Component itemCollider, bool fromNearby)
82
82
var throwable = entity . Require < ThrowableComponent > ( ) ;
83
83
if ( fromNearby && throwable . throwerId == context . playerId && throwable . thrownElapsedUs < 2_000_000u ) return ;
84
84
85
- if ( ! ( TryAddItem ( inventory , checked ( ( byte ) ( itemEntityModifier . id - 100 ) ) ) is { } index ) ) return ;
85
+ if ( TryAddItem ( inventory , checked ( ( byte ) ( itemEntityModifier . id - 100 ) ) ) is not { } index ) return ;
86
86
87
87
var itemOnEntity = entity . Require < ItemComponent > ( ) ;
88
88
ItemComponent item = inventory [ index ] ;
@@ -205,7 +205,7 @@ private static void ModifyEquipStatus(in SessionContext context, InventoryCompon
205
205
private static void ModifyAdsStatus ( in SessionContext context , InventoryComponent inventory , InputFlagProperty inputs )
206
206
{
207
207
ItemModifierBase modifier = ItemAssetLink . GetModifier ( inventory . EquippedItemComponent . id ) ;
208
- if ( ! ( modifier is GunModifierBase gunModifier ) ) return ;
208
+ if ( modifier is not GunModifierBase gunModifier ) return ;
209
209
210
210
if ( inputs . GetInput ( PlayerInput . Ads ) )
211
211
{
@@ -348,13 +348,13 @@ public static void RefillAllAmmo(InventoryComponent inventory)
348
348
public static void SetAllItems ( InventoryComponent inventory , params byte [ ] ids )
349
349
{
350
350
for ( var i = 0 ; i < inventory . items . Length ; i ++ )
351
- SetItemAtIndex ( inventory , i < ids . Length ? ids [ i ] : ( byte ? ) null , i ) ;
351
+ SetItemAtIndex ( inventory , i < ids . Length ? ids [ i ] : null , i ) ;
352
352
}
353
353
354
354
public static void SetItemAtIndex ( InventoryComponent inventory , byte ? _itemId , int index , ushort count = 1 )
355
355
{
356
356
ItemComponent item = inventory [ index ] ;
357
- if ( ! ( _itemId is { } itemId ) )
357
+ if ( _itemId is not { } itemId )
358
358
{
359
359
item . Clear ( ) ;
360
360
if ( inventory . equippedIndex == index )
@@ -373,7 +373,7 @@ public static void SetItemAtIndex(InventoryComponent inventory, byte? _itemId, i
373
373
item . ammoInMag . Value = gunModifier . MagSize ;
374
374
item . ammoInReserve . Value = gunModifier . StartingAmmoInReserve ;
375
375
break ;
376
- case ThrowableItemModifierBase _ :
376
+ case ThrowableItemModifierBase :
377
377
item . ammoInReserve . Value = count ;
378
378
break ;
379
379
}
0 commit comments