]> git.deb.at Git - rhonda/impostor.git/commitdiff
Allow host-only mods to desync murder roles
authorminiduikboot <mini@duikbo.at>
Sat, 9 Mar 2024 11:19:49 +0000 (12:19 +0100)
committerminiduikboot <mini@duikbo.at>
Thu, 4 Apr 2024 18:10:23 +0000 (20:10 +0200)
src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs

index a4ee87a1e60d6d3ea8ce5fcee6767f63b9708b24..a45af1d6a7a8c9597011649a2006cfa26b7bf9e2 100644 (file)
@@ -804,7 +804,9 @@ namespace Impostor.Server.Net.Inner.Objects
                 }
             }
 
-            if (target == null || target.PlayerInfo.IsImpostor)
+            // Host-only mods intentionally desync players, so it may appear that one killing role (like a genuine impostor) is killing another
+            // killing role (like an sheriff). So this needs to be allowed if the host requested authority.
+            if (target == null || (target.PlayerInfo.IsImpostor && !_game.IsHostAuthoritive))
             {
                 if (await sender.Client.ReportCheatAsync(RpcCalls.CheckMurder, CheatCategory.GameFlow, "Client tried to murder invalid target"))
                 {
@@ -849,7 +851,7 @@ namespace Impostor.Server.Net.Inner.Objects
                 }
             }
 
-            if (target == null || target.PlayerInfo.IsImpostor)
+            if (target == null)
             {
                 if (await sender.Client.ReportCheatAsync(RpcCalls.MurderPlayer, CheatCategory.GameFlow, "Client tried to murder invalid target"))
                 {