File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ static class PatchReplicableRequest
3030 public static void Patch ( PatchContext ctx )
3131 {
3232 //temporarily disabled because BitStream.ResetRead is throwing dumbass exceptions
33- // ctx.GetPattern(_requestMethod).Prefixes.Add(typeof(PatchReplicableRequest).GetMethod(nameof(PrefixRequest)));
33+ ctx . GetPattern ( _requestMethod ) . Prefixes . Add ( typeof ( PatchReplicableRequest ) . GetMethod ( nameof ( PrefixRequest ) ) ) ;
3434 }
3535
3636 public static void PrefixRequest ( MyPacket packet )
@@ -40,11 +40,14 @@ public static void PrefixRequest(MyPacket packet)
4040 var stream = packet . BitStream ;
4141 var id = stream . ReadInt64 ( ) ;
4242 bool add = stream . ReadBool ( ) ;
43+ if ( add )
44+ stream . ReadByte ( ) ;
4345
44- var g = ConcealmentPlugin . Instance . ConcealedGroups . First ( gr => gr . Grids . Any ( q => q . EntityId == id ) ) ;
46+ var g = ConcealmentPlugin . Instance . ConcealedGroups . FirstOrDefault ( gr => gr . Grids . Any ( q => q . EntityId == id ) ) ;
4547 if ( g != null && add )
4648 ConcealmentPlugin . Instance . RevealGroup ( g ) ;
4749
50+ stream . ResetWrite ( ) ;
4851 stream . ResetRead ( ) ;
4952 }
5053 catch ( Exception ex )
@@ -55,6 +58,7 @@ public static void PrefixRequest(MyPacket packet)
5558 finally
5659 {
5760 //this allows us to fail gracefully
61+ packet . BitStream . ResetWrite ( ) ;
5862 packet . BitStream . ResetRead ( ) ;
5963 }
6064 }
You can’t perform that action at this time.
0 commit comments