From 70cbea4f17cf4fc8d7b66e04687b5260d66c39f3 Mon Sep 17 00:00:00 2001 From: g0aty Date: Thu, 12 Sep 2024 22:06:07 +0530 Subject: [PATCH] Re-add killing impostors --- gui/tabs/host_tab.cpp | 3 --- gui/tabs/self_tab.cpp | 8 ++++---- hooks/PlayerControl.cpp | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gui/tabs/host_tab.cpp b/gui/tabs/host_tab.cpp index 3955b57..9bb5d7b 100644 --- a/gui/tabs/host_tab.cpp +++ b/gui/tabs/host_tab.cpp @@ -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(); diff --git a/gui/tabs/self_tab.cpp b/gui/tabs/self_tab.cpp index 790a0a8..49cbbbd 100644 --- a/gui/tabs/self_tab.cpp +++ b/gui/tabs/self_tab.cpp @@ -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(); @@ -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(); } diff --git a/hooks/PlayerControl.cpp b/hooks/PlayerControl.cpp index af322bf..d27f152 100644 --- a/hooks/PlayerControl.cpp +++ b/hooks/PlayerControl.cpp @@ -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) { @@ -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) {