@@ -8,7 +8,7 @@ namespace TheOtherRoles.Roles.Impostor;
88
99public class Grenadier
1010{
11- public static PlayerControl grenadier ;
11+ public static PlayerControl Player ;
1212 public static Color color = Palette . ImpostorRed ;
1313 public static Color flash = new Color32 ( 150 , 150 , 150 , byte . MaxValue ) ;
1414 public static List < PlayerControl > controls = new ( ) ;
@@ -37,12 +37,12 @@ public static void showFlash(Color color, float duration = 10f, float alpha = 1f
3737 if ( InMeeting )
3838 {
3939 renderer . enabled = false ;
40- if ( CachedPlayer . LocalId == grenadier . PlayerId && controls . Count > 0 )
40+ if ( PlayerControl . LocalPlayer . PlayerId == Player ? . PlayerId && controls ? . Count > 0 )
4141 {
42- var writer = AmongUsClient . Instance . StartRpcImmediately ( CachedPlayer . LocalPlayer . PlayerControl . NetId ,
43- ( byte ) CustomRPC . GrenadierFlash , SendOption . Reliable ) ;
42+ var writer = StartRPC ( PlayerControl . LocalPlayer , CustomRPC . GrenadierFlash ) ;
4443 writer . Write ( true ) ;
45- AmongUsClient . Instance . FinishRpcImmediately ( writer ) ;
44+ writer . EndRPC ( ) ;
45+ RPCProcedure . grenadierFlash ( true ) ;
4646 controls . Clear ( ) ;
4747 }
4848 return ;
@@ -58,12 +58,12 @@ public static void showFlash(Color color, float duration = 10f, float alpha = 1f
5858 var fadeOutProgress = ( p - ( 1 - fadeFraction ) ) / fadeFraction ;
5959 if ( renderer != null ) renderer . color = new Color ( color . r , color . g , color . b , Mathf . Clamp01 ( ( 1 - fadeOutProgress ) * alpha ) ) ;
6060
61- if ( CachedPlayer . LocalId == grenadier . PlayerId && controls . Count > 0 )
61+ if ( PlayerControl . LocalPlayer . PlayerId == Player ? . PlayerId && controls ? . Count > 0 )
6262 {
63- var writer = AmongUsClient . Instance . StartRpcImmediately ( CachedPlayer . LocalPlayer . PlayerControl . NetId ,
64- ( byte ) CustomRPC . GrenadierFlash , SendOption . Reliable ) ;
63+ var writer = StartRPC ( PlayerControl . LocalPlayer , CustomRPC . GrenadierFlash ) ;
6564 writer . Write ( true ) ;
66- AmongUsClient . Instance . FinishRpcImmediately ( writer ) ;
65+ writer . EndRPC ( ) ;
66+ RPCProcedure . grenadierFlash ( true ) ;
6767 controls . Clear ( ) ;
6868 }
6969 }
@@ -78,7 +78,7 @@ public static void showFlash(Color color, float duration = 10f, float alpha = 1f
7878
7979 public static void clearAndReload ( )
8080 {
81- grenadier = null ;
81+ Player = null ;
8282 controls . Clear ( ) ;
8383 cooldown = CustomOptionHolder . grenadierCooldown . GetFloat ( ) ;
8484 duration = CustomOptionHolder . grenadierDuration . GetFloat ( ) + 0.5f ;
0 commit comments