Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #272 from NotSugden/patch-1
Browse files Browse the repository at this point in the history
chore: remove comment
  • Loading branch information
cybershard authored Jul 20, 2021
2 parents 148900b + cf0df8d commit c2b3f11
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions source/Patches/RpcHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,6 @@ internal static bool Check(int probability)
return num <= probability;
}

/*
private static void GenExe(List<GameData.PlayerInfo> infected, List<PlayerControl> crewmates)
{
PlayerControl pc;
var targets = Utils.getCrewmates(infected).Where(x =>
{
var role = Role.GetRole(x);
if (role == null) return true;
return role.Faction == Faction.Crewmates;
}).ToList();
if (targets.Count > 1)
{
var rand = Random.RandomRangeInt(0, targets.Count);
pc = targets[rand];
var role = Role.Gen(typeof(Executioner), crewmates.Where(x => x.PlayerId != pc.PlayerId).ToList(),
CustomRPC.SetExecutioner);
if (role != null)
{
crewmates.Remove(role.Player);
var writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId,
(byte) CustomRPC.SetTarget, SendOption.Reliable, -1);
writer.Write(role.Player.PlayerId);
writer.Write(pc.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
((Executioner) role).target = pc;
}
}
}*/

private static void SortRoles(List<(Type, CustomRPC, int)> roles, int max = int.MaxValue)
{
roles.Shuffle();
Expand Down Expand Up @@ -174,7 +145,7 @@ private static void GenEachRole(List<GameData.PlayerInfo> infected)
foreach (var (type, rpc, _) in GlobalModifiers)
Role.Gen<Modifier>(type, canHaveModifier, rpc);

canHaveModifier.RemoveAll(player => !player.Data.IsImpostor);
canHaveModifier.RemoveAll(player => !player.Is(Faction.Crewmates));
canHaveModifier.Shuffle();

while (canHaveModifier.Count > 0)
Expand Down

0 comments on commit c2b3f11

Please sign in to comment.