quick fixes

This commit is contained in:
Gurge44 committed 2026-08-26 10:33:18 +02:00
1 parent 93418c4cad
commit a61555fcdb
6 files changed
+137 -36

No files matched your search

+52 -1
View File
@@ -223,7 +223,58 @@ jobs:
path: ./EHR*.zip path: ./EHR*.zip
# --------------------------------------------------------- # ---------------------------------------------------------
# 5) Create GitHub Release # 5) Upload releases to CurseForge
# ---------------------------------------------------------
publish-curseforge:
runs-on: ubuntu-latest
needs: [package]
steps:
- uses: actions/checkout@v4
- name: Download packaged ZIPs
uses: actions/download-artifact@v4
with:
name: final-zips
path: release-artifacts
- name: Read changelog
id: changelog
run: |
{
echo 'content<<EOF'
cat CHANGELOG.md
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Upload Epic / Microsoft Store build to CurseForge
uses: itsmeow/curseforge-upload@v3
with:
token: ${{ secrets.CURSEFORGE_API_TOKEN }}
project_id: ${{ secrets.CURSEFORGE_PROJECT_ID }}
game_endpoint: among-us
file_path: release-artifacts/EHR.v${{ github.event.inputs.version }}_Epic-Games_Microsoft-Store.zip
display_name: EHR v${{ github.event.inputs.version }} (x64 - Epic/MS Store)
release_type: release
changelog_type: markdown
changelog: ${{ steps.changelog.outputs.content }}
game_versions: "18.0.0"
- name: Upload Steam build to CurseForge
uses: itsmeow/curseforge-upload@v3
with:
token: ${{ secrets.CURSEFORGE_API_TOKEN }}
project_id: ${{ secrets.CURSEFORGE_PROJECT_ID }}
game_endpoint: among-us
file_path: release-artifacts/EHR.v${{ github.event.inputs.version }}_Steam.zip
display_name: EHR v${{ github.event.inputs.version }} (x86 - Steam)
release_type: release
changelog_type: markdown
changelog: ${{ steps.changelog.outputs.content }}
game_versions: "18.0.0"
# ---------------------------------------------------------
# 6) Create GitHub Release
# --------------------------------------------------------- # ---------------------------------------------------------
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+2 -2
View File
@@ -41,8 +41,8 @@ public class Main : BasePlugin
private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d"; private const string DebugKeyHash = "c0fd562955ba56af3ae20d7ec9e64c664f0facecef4b3e366e109306adeae29d";
private const string DebugKeySalt = "59687b"; private const string DebugKeySalt = "59687b";
public const string PluginGuid = "com.gurge44.endlesshostroles"; public const string PluginGuid = "com.gurge44.endlesshostroles";
public const string PluginVersion = "8.0.0"; public const string PluginVersion = "8.0.1";
public const string PluginDisplayVersion = "8.0.0"; public const string PluginDisplayVersion = "8.0.1";
public const int TestBuildNumber = 0; // 0 = Release public const int TestBuildNumber = 0; // 0 = Release
public const string NeutralColor = "#ffab1b"; public const string NeutralColor = "#ffab1b";
+1 -1
View File
@@ -209,7 +209,7 @@ public static class Camouflage
} }
// if the current Outfit is the same, return // if the current Outfit is the same, return
if (newOutfit.Compare(target.Data.DefaultOutfit)) if (IsCamouflage && newOutfit.Compare(target.Data.DefaultOutfit))
{ {
Logger.Info("Outfit is the same, returning", "Camouflage.RpcSetSkin"); Logger.Info("Outfit is the same, returning", "Camouflage.RpcSetSkin");
return; return;
+32 -32
View File
@@ -280,46 +280,46 @@ public static class Utils
switch (type) switch (type)
{ {
case SystemTypes.Electrical: case SystemTypes.Electrical:
{ {
if (mapId == 5) return false; if (mapId == 5) return false;
return ShipStatusSystem.SwitchSystem != null && ShipStatusSystem.SwitchSystem.IsActive; return ShipStatusSystem.SwitchSystem != null && ShipStatusSystem.SwitchSystem.IsActive;
} }
case SystemTypes.Reactor: case SystemTypes.Reactor:
{
return mapId switch
{ {
return mapId switch 2 => false,
{ 4 => ShipStatusSystem.HeliSabotageSystem && ShipStatusSystem.HeliSabotageSystem.IsActive,
2 => false, _ => ShipStatusSystem.ReactorSystemType != null && ShipStatusSystem.ReactorSystemType.IsActive
4 => ShipStatusSystem.HeliSabotageSystem && ShipStatusSystem.HeliSabotageSystem.IsActive, };
_ => ShipStatusSystem.ReactorSystemType != null && ShipStatusSystem.ReactorSystemType.IsActive }
};
}
case SystemTypes.Laboratory: case SystemTypes.Laboratory:
{ {
if (mapId != 2) return false; if (mapId != 2) return false;
return ShipStatusSystem.ReactorSystemType != null && ShipStatusSystem.ReactorSystemType.IsActive; return ShipStatusSystem.ReactorSystemType != null && ShipStatusSystem.ReactorSystemType.IsActive;
} }
case SystemTypes.LifeSupp: case SystemTypes.LifeSupp:
{ {
if (mapId is 2 or 4 or 5) return false; if (mapId is 2 or 4 or 5) return false;
return ShipStatusSystem.LifeSuppSystemType != null && ShipStatusSystem.LifeSuppSystemType.IsActive; return ShipStatusSystem.LifeSuppSystemType != null && ShipStatusSystem.LifeSuppSystemType.IsActive;
} }
case SystemTypes.Comms: case SystemTypes.Comms:
{ {
if (mapId is 1 or 5) if (mapId is 1 or 5)
return ShipStatusSystem.HqHudSystemType != null && ShipStatusSystem.HqHudSystemType.IsActive; return ShipStatusSystem.HqHudSystemType != null && ShipStatusSystem.HqHudSystemType.IsActive;
return ShipStatusSystem.HudOverrideSystemType != null && ShipStatusSystem.HudOverrideSystemType.IsActive; return ShipStatusSystem.HudOverrideSystemType != null && ShipStatusSystem.HudOverrideSystemType.IsActive;
} }
case SystemTypes.HeliSabotage: case SystemTypes.HeliSabotage:
{ {
if (mapId != 4) return false; if (mapId != 4) return false;
return ShipStatusSystem.HeliSabotageSystem && ShipStatusSystem.HeliSabotageSystem.IsActive; return ShipStatusSystem.HeliSabotageSystem && ShipStatusSystem.HeliSabotageSystem.IsActive;
} }
case SystemTypes.MushroomMixupSabotage: case SystemTypes.MushroomMixupSabotage:
{ {
if (mapId != 5) return false; if (mapId != 5) return false;
return ShipStatusSystem.MushroomMixupSabotageSystem && ShipStatusSystem.MushroomMixupSabotageSystem.IsActive; return ShipStatusSystem.MushroomMixupSabotageSystem && ShipStatusSystem.MushroomMixupSabotageSystem.IsActive;
} }
default: default:
return false; return false;
} }
+4
View File
@@ -1321,10 +1321,14 @@ internal static class ChatCommands
if (pc == null) return; if (pc == null) return;
if (ForcedSpectators.Remove(targetId)) if (ForcedSpectators.Remove(targetId))
{
Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("SpectateCommand.RemovedForcedSpectator"), targetId.ColoredPlayerName())); Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("SpectateCommand.RemovedForcedSpectator"), targetId.ColoredPlayerName()));
return;
}
if (ForcedSpectators.Add(targetId)) if (ForcedSpectators.Add(targetId))
Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("SpectateCommand.ForcedSpectator"), targetId.ColoredPlayerName())); Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("SpectateCommand.ForcedSpectator"), targetId.ColoredPlayerName()));
return; return;
} }
+46
View File
@@ -22,6 +22,7 @@ internal static class CheckForEndVotingPatch
public static string EjectionText = string.Empty; public static string EjectionText = string.Empty;
public static NetworkedPlayerInfo TempExiledPlayer; public static NetworkedPlayerInfo TempExiledPlayer;
public static bool ShouldSkip; public static bool ShouldSkip;
public static bool CommsWasCalled;
private static readonly List<MeetingHud.VoterState> StatesList = []; private static readonly List<MeetingHud.VoterState> StatesList = [];
private static MeetingHud.VoterState[] States = []; private static MeetingHud.VoterState[] States = [];
@@ -1074,6 +1075,13 @@ internal static class MeetingHudStartPatch
{ {
if (!MeetingHud.Instance || MeetingHud.Instance.state is MeetingHud.MeetingStates.Results or MeetingHud.MeetingStates.Proceeding) return; if (!MeetingHud.Instance || MeetingHud.Instance.state is MeetingHud.MeetingStates.Results or MeetingHud.MeetingStates.Proceeding) return;
if (Utils.IsActive(SystemTypes.Comms))
{
CheckForEndVotingPatch.CommsWasCalled = true;
if (Main.NormalOptions.MapId is 1 or 5) ShipStatus.Instance.UpdateSystem(SystemTypes.Comms, PlayerControl.LocalPlayer, 17);
ShipStatus.Instance.UpdateSystem(SystemTypes.Comms, PlayerControl.LocalPlayer, 16);
}
Main.EnumerateAlivePlayerControls().DoIf(x => x.UsesJudgeAbilityAsTrigger(), x => x.RpcSetRoleDesync(RoleTypes.Judge, x.OwnerId)); Main.EnumerateAlivePlayerControls().DoIf(x => x.UsesJudgeAbilityAsTrigger(), x => x.RpcSetRoleDesync(RoleTypes.Judge, x.OwnerId));
}, 1f, "Set Shapeshifter Role For Meeting Use"); }, 1f, "Set Shapeshifter Role For Meeting Use");
} }
@@ -1381,6 +1389,16 @@ internal static class MeetingHudOnDestroyPatch
pc.RpcMakeInvisible(); pc.RpcMakeInvisible();
} }
catch (Exception e) { Utils.ThrowException(e); } catch (Exception e) { Utils.ThrowException(e); }
try
{
if (CheckForEndVotingPatch.CommsWasCalled)
{
CheckForEndVotingPatch.CommsWasCalled = false;
ShipStatus.Instance.UpdateSystem(SystemTypes.Comms, PlayerControl.LocalPlayer, 128);
}
}
catch (Exception e) { Utils.ThrowException(e); }
bool meetingSS = Options.UseMeetingShapeshift.GetBool(); bool meetingSS = Options.UseMeetingShapeshift.GetBool();
bool meetingSSForGuessing = Options.UseMeetingShapeshiftForGuessing.GetBool(); bool meetingSSForGuessing = Options.UseMeetingShapeshiftForGuessing.GetBool();
@@ -1593,6 +1611,34 @@ static class MeetingHud_Start
} }
} }
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.CmdQueueOverruleVotes))]
static class MeetingHudCmdQueueOverruleVotesPatch
{
public static bool Prefix(MeetingHud __instance, [HarmonyArgument(1)] PlayerId targetPlayerId)
{
if (!AmongUsClient.Instance.AmHost) return true;
PlayerControl target = targetPlayerId.Value.GetPlayer();
if (target && PlayerControl.LocalPlayer.UsesJudgeAbilityAsTrigger() && Main.PlayerStates.TryGetValue(PlayerControl.LocalPlayer.PlayerId, out PlayerState state))
{
state.Role.OnJudge(PlayerControl.LocalPlayer, target);
if (__instance.playerStates.FindFirst(x => x.PlayerId == PlayerControl.LocalPlayer.PlayerId, out PlayerVoteArea pva))
{
pva.UnsetVote();
__instance.RpcClearVote(pva.PlayerId);
__instance.UpdateForeground();
pva.VotedForId = byte.MaxValue;
}
return false;
}
return true;
}
}
// All below are from: https://github.com/EnhancedNetwork/TownofHost-Enhanced (with some modifications) // All below are from: https://github.com/EnhancedNetwork/TownofHost-Enhanced (with some modifications)
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.RpcClose))] [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.RpcClose))]