Skip to content

Commit f292152

Browse files
committed
fix: prevent getting kicked when reporting body as host
1 parent 33da492 commit f292152

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

src/Cheats/MalumPPMCheats.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ public static void reportBodyPPM(){
3232
// Player pick menu to choose any body (alive or dead) and report it
3333
PlayerPickMenu.openPlayerPickMenu(Utils.GetAllPlayerData(), (Action) (() =>
3434
{
35-
36-
Utils.reportDeadBody(PlayerPickMenu.targetPlayerData);
37-
35+
PlayerControl.LocalPlayer.CmdReportDeadBody(PlayerPickMenu.targetPlayerData);
3836
}));
3937

4038
reportBodyActive = true;

src/Utilities/Utils.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -165,25 +165,6 @@ public static void murderPlayer(PlayerControl target, MurderResultFlags result)
165165
}
166166
}
167167

168-
// Report bodies using RPC calls
169-
public static void reportDeadBody(NetworkedPlayerInfo playerData)
170-
{
171-
172-
if (isFreePlay){
173-
174-
PlayerControl.LocalPlayer.CmdReportDeadBody(playerData);
175-
return;
176-
177-
}
178-
179-
var HostData = AmongUsClient.Instance.GetHost();
180-
if (HostData == null || HostData.Character.Data.Disconnected) return;
181-
var writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)RpcCalls.ReportDeadBody, SendOption.None, HostData.Id);
182-
writer.Write(playerData.PlayerId);
183-
AmongUsClient.Instance.FinishRpcImmediately(writer);
184-
}
185-
186-
187168
// Complete all of LocalPlayer's tasks using RPC calls
188169
public static void completeMyTasks()
189170
{

0 commit comments

Comments
 (0)