@@ -66,14 +66,14 @@ public void OnChangingRole(ChangingRoleEventArgs ev)
6666
6767 public void OnSpawned ( SpawnedEventArgs ev )
6868 {
69- if ( ev . Player == null )
69+ if ( ev . Player is null )
7070 {
7171 Log . Warn ( $ "{ nameof ( OnSpawned ) } : Triggering player is null.") ;
7272 return ;
7373 }
7474
7575 RoleTypeId newRole = ev . Player . Role . Type ;
76- if ( config . HealthValues != null && config . HealthValues . TryGetValue ( newRole , out int health ) )
76+ if ( config . HealthValues is not null && config . HealthValues . TryGetValue ( newRole , out int health ) )
7777 {
7878 ev . Player . MaxHealth = health ;
7979 ev . Player . Health = health ;
@@ -84,7 +84,7 @@ public void OnSpawned(SpawnedEventArgs ev)
8484 ev . Player . CustomInfo = $ "({ ev . Player . Health } /{ ev . Player . MaxHealth } ) { ( ! string . IsNullOrEmpty ( ev . Player . CustomInfo ) ? ev . Player . CustomInfo . Substring ( ev . Player . CustomInfo . LastIndexOf ( ')' ) + 1 ) : string . Empty ) } ";
8585 }
8686
87- if ( config . AfkIgnoredRoles . Contains ( newRole ) && Plugin . AfkDict . TryGetValue ( ev . Player , out Tuple < int , Vector3 > value ) )
87+ if ( config . AfkIgnoredRoles is not null && config . AfkIgnoredRoles . Contains ( newRole ) && Plugin . AfkDict . TryGetValue ( ev . Player , out Tuple < int , Vector3 > value ) )
8888 {
8989 Plugin . AfkDict [ ev . Player ] =
9090 new Tuple < int , Vector3 > ( newRole is RoleTypeId . Spectator ? value . Item1 : 0 , ev . Player . Position ) ;
@@ -93,21 +93,21 @@ public void OnSpawned(SpawnedEventArgs ev)
9393
9494 public void OnPlayerDied ( DiedEventArgs ev )
9595 {
96- if ( ev . Attacker != null && config . HealthOnKill . ContainsKey ( ev . Attacker . Role ) )
96+ if ( ev . Attacker is not null && config . HealthOnKill is not null && config . HealthOnKill . ContainsKey ( ev . Attacker . Role ) )
9797 {
9898 ev . Attacker . Heal ( config . HealthOnKill [ ev . Attacker . Role ] ) ;
9999 }
100100 }
101101
102102 public void OnPlayerHurting ( HurtingEventArgs ev )
103103 {
104- if ( config . RoleDamageDealtMultipliers != null && ev . Attacker != null && config . RoleDamageDealtMultipliers . TryGetValue ( ev . Attacker . Role , out var damageMultiplier ) )
104+ if ( config . RoleDamageDealtMultipliers is not null && ev . Attacker is not null && config . RoleDamageDealtMultipliers . TryGetValue ( ev . Attacker . Role , out var damageMultiplier ) )
105105 ev . Amount *= damageMultiplier ;
106106
107- if ( config . RoleDamageReceivedMultipliers != null && config . RoleDamageReceivedMultipliers . TryGetValue ( ev . Player . Role , out damageMultiplier ) )
107+ if ( config . RoleDamageReceivedMultipliers is not null && config . RoleDamageReceivedMultipliers . TryGetValue ( ev . Player . Role , out damageMultiplier ) )
108108 ev . Amount *= damageMultiplier ;
109109
110- if ( config . DamageMultipliers != null && config . DamageMultipliers . TryGetValue ( ev . DamageHandler . Type , out damageMultiplier ) )
110+ if ( config . DamageMultipliers is not null && config . DamageMultipliers . TryGetValue ( ev . DamageHandler . Type , out damageMultiplier ) )
111111 ev . Amount *= damageMultiplier ;
112112
113113 if ( config . PlayerHealthInfo )
0 commit comments