mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
fix meeting ss non-imp guessers seeing imps
This commit is contained in:
1 parent
92a91bbd74
commit
cd6b61a8e9
3 files changed
+9
-13
No files matched your search
@@ -1111,12 +1111,7 @@ public static class GuessManager
|
||||
HashSet<byte> guessers = Main.AllAlivePlayerControls.Where(x => !x.IsModdedClient() && CanGuess(x, restrictions)).Select(x => x.PlayerId).ToHashSet();
|
||||
bool meetingSS = Options.UseMeetingShapeshift.GetBool() && Options.UseMeetingShapeshiftForGuessing.GetBool();
|
||||
LateTask.New(() => guessers.Do(x => Utils.SendMessage(GetString(meetingSS ? "YouCanGuessMeetingSS" : "YouCanGuess"), x, GetString("YouCanGuessTitle"))), 12f, log: false);
|
||||
|
||||
if (meetingSS)
|
||||
{
|
||||
LateTask.New(() => guessers.ToValidPlayers().DoIf(x => !x.UsesMeetingShapeshift(), x => x.RpcSetRoleDesync(RoleTypes.Shapeshifter, x.OwnerId)), 8f, "Meeting Shapeshift Setup For Guessing");
|
||||
Data = guessers.ToDictionary(x => x, x => new MeetingShapeshiftData(x));
|
||||
}
|
||||
if (meetingSS) Data = guessers.ToDictionary(x => x, x => new MeetingShapeshiftData(x));
|
||||
}
|
||||
|
||||
PlayerControl lp = PlayerControl.LocalPlayer;
|
||||
|
||||
@@ -284,10 +284,7 @@ public static class Translator
|
||||
|
||||
private static void CreateTemplateFile()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (KeyValuePair<string, Dictionary<int, string>> title in TranslateMaps) sb.Append($"{title.Key}:\n");
|
||||
|
||||
File.WriteAllText($"{Main.DataPath}/{LanguageFolderName}/template.dat", sb.ToString());
|
||||
File.WriteAllText($"{Main.DataPath}/{LanguageFolderName}/template.dat", string.Join('\n', TranslateMaps.Keys.Select(x => $"{x}:")));
|
||||
}
|
||||
|
||||
public static void ExportCustomTranslation()
|
||||
|
||||
@@ -992,10 +992,12 @@ internal static class MeetingHudStartPatch
|
||||
if (!MeetingHud.Instance || MeetingHud.Instance.state is MeetingHud.VoteStates.Results or MeetingHud.VoteStates.Proceeding) return;
|
||||
|
||||
PlayerControl[] aapc = Main.AllAlivePlayerControls;
|
||||
bool restrictions = Options.GuesserNumRestrictions.GetBool();
|
||||
bool meetingSSForGuessing = Options.UseMeetingShapeshiftForGuessing.GetBool();
|
||||
|
||||
foreach (PlayerControl pc in aapc)
|
||||
{
|
||||
if (pc.UsesMeetingShapeshift())
|
||||
if (pc.UsesMeetingShapeshift() || (meetingSSForGuessing && !pc.IsModdedClient() && GuessManager.StartMeetingPatch.CanGuess(pc, restrictions)))
|
||||
{
|
||||
var sender = CustomRpcSender.Create($"RpcSetRoleDesync for meeting shapeshift ({Main.AllPlayerNames.GetValueOrDefault(pc.PlayerId, "Someone")})", SendOption.Reliable);
|
||||
sender.RpcSetRole(pc, RoleTypes.Shapeshifter, pc.OwnerId);
|
||||
@@ -1262,8 +1264,9 @@ internal static class MeetingHudOnDestroyPatch
|
||||
LateTask.New(() => GameEndChecker.ShouldNotCheck = false, 15f, "Re-enable GameEndChecker after meeting");
|
||||
|
||||
bool meetingSS = Options.UseMeetingShapeshift.GetBool();
|
||||
bool meetingSSForGuessing = Options.UseMeetingShapeshiftForGuessing.GetBool();
|
||||
|
||||
if (meetingSS && Options.UseMeetingShapeshiftForGuessing.GetBool())
|
||||
if (meetingSS && meetingSSForGuessing)
|
||||
{
|
||||
GuessManager.Data.Values.Do(x => x.Reset());
|
||||
GuessManager.Data.Clear();
|
||||
@@ -1277,7 +1280,8 @@ internal static class MeetingHudOnDestroyPatch
|
||||
if (meetingSS && !AntiBlackout.SkipTasks)
|
||||
{
|
||||
PlayerControl[] aapc = Main.AllAlivePlayerControls;
|
||||
aapc.DoIf(x => x.UsesMeetingShapeshift(), x => x.RpcSetRoleDesync(x.GetRoleTypes(), x.OwnerId));
|
||||
bool restrictions = Options.GuesserNumRestrictions.GetBool();
|
||||
aapc.DoIf(x => x.UsesMeetingShapeshift() || (meetingSSForGuessing && !x.IsModdedClient() && GuessManager.StartMeetingPatch.CanGuess(x, restrictions)), x => x.RpcSetRoleDesync(x.GetRoleTypes(), x.OwnerId));
|
||||
aapc.DoIf(x => x.IsImpostor(), x => x.RpcSetRoleGlobal(x.GetRoleTypes()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user