]> git.deb.at Git - rhonda/impostor.git/commitdiff
Fixes incorrect anticheat detection #77
authorAeonLucid <aeonlucid@outlook.com>
Sun, 25 Oct 2020 20:25:21 +0000 (21:25 +0100)
committerAeonLucid <aeonlucid@outlook.com>
Sun, 25 Oct 2020 20:25:21 +0000 (21:25 +0100)
src/Impostor.Server/Net/Inner/Objects/InnerShipStatus.cs

index cab8be1f55957ffd1781a4931f54575e05e6eb72..b1a3f18f9b08864cacc33b7a92dec78ba2f4540d 100644 (file)
@@ -75,17 +75,16 @@ namespace Impostor.Server.Net.Inner.Objects
                         throw new ImpostorCheatException($"Client sent {nameof(RpcCalls.RepairSystem)} to wrong destinition, must be host");
                     }
 
-                    if (!sender.Character.PlayerInfo.IsImpostor)
+                    var systemType = (SystemTypes)reader.ReadByte();
+                    if (systemType == SystemTypes.Sabotage && !sender.Character.PlayerInfo.IsImpostor)
                     {
-                        throw new ImpostorCheatException($"Client sent {nameof(RpcCalls.RepairSystem)} as crewmate");
+                        throw new ImpostorCheatException($"Client sent {nameof(RpcCalls.RepairSystem)} for {systemType} as crewmate");
                     }
 
-                    var systemType = (SystemTypes)reader.ReadByte();
                     var player = reader.ReadNetObject<InnerPlayerControl>(_game);
                     var amount = reader.ReadByte();
 
                     // TODO: Modify data (?)
-
                     break;
                 }