Skip to content

Commit

Permalink
Re-add killing impostors
Browse files Browse the repository at this point in the history
  • Loading branch information
g0aty committed Sep 12, 2024
1 parent 3e26dd3 commit 70cbea4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions gui/tabs/host_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ namespace HostTab {
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcSetRole(*Game::pLocalPlayer, RoleTypes__Enum::Crewmate));
}
}*/
if (ToggleButton("Kill Other Impostors", &State.KillImpostors)) {
State.Save();
}

if (ToggleButton("Unlock Kill Button", &State.UnlockKillButton)) {
State.Save();
Expand Down
8 changes: 4 additions & 4 deletions gui/tabs/self_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ namespace SelfTab {
if (ToggleButton("God Mode", &State.GodMode))
State.Save();
//}
ImGui::SameLine();
if (ToggleButton("Kill Other Impostors", &State.KillImpostors)) {
State.Save();
}

if (ToggleButton("(Shift + Right Click) to Teleport", &State.ShiftRightClickTP)) {
State.Save();
Expand Down Expand Up @@ -437,10 +441,6 @@ namespace SelfTab {
}

if (!State.SafeMode) {
if (ToggleButton("Kill Other Impostors", &State.KillImpostors)) {
State.Save();
}
ImGui::SameLine();
if (ToggleButton("Unlock Kill Button", &State.UnlockKillButton)) {
State.Save();
}
Expand Down
4 changes: 2 additions & 2 deletions hooks/PlayerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ void dKillButton_SetTarget(KillButton* __this, PlayerControl* target, MethodInfo
for (auto p : GetAllPlayerControl()) {
if (p == *Game::pLocalPlayer) continue; //we don't want to kill ourselves
auto pData = GetPlayerData(p);
if (PlayerIsImpostor(pData) && !((State.KillImpostors && (IsHost() || !State.SafeMode)) || (IsHost() && State.BattleRoyale))) continue; //neither impostors
if (PlayerIsImpostor(pData) && !(State.KillImpostors || (IsHost() && State.BattleRoyale))) continue; //neither impostors
if (pData->fields.IsDead) continue; //nor ghosts
float currentDist = GetDistanceBetweenPoints_Unity(GetTrueAdjustedPosition(p), localPos);
if (currentDist < max_dist) {
Expand Down Expand Up @@ -1150,7 +1150,7 @@ PlayerControl* dImpostorRole_FindClosestTarget(ImpostorRole* __this, MethodInfo*
for (auto p : GetAllPlayerControl()) {
if (p == *Game::pLocalPlayer) continue; //we don't want to kill ourselves
auto pData = GetPlayerData(p);
if (PlayerIsImpostor(pData) && !((State.KillImpostors && (IsHost() || !State.SafeMode)) || (IsHost() && State.BattleRoyale))) continue; //neither impostors
if (PlayerIsImpostor(pData) && !(State.KillImpostors || (IsHost() && State.BattleRoyale))) continue; //neither impostors
if (pData->fields.IsDead) continue; //nor ghosts
float currentDist = GetDistanceBetweenPoints_Unity(GetTrueAdjustedPosition(p), localPos);
if (currentDist < max_dist) {
Expand Down

0 comments on commit 70cbea4

Please sign in to comment.