From 1ad4c694d7a5efa2df40370694dbf8cff203257c Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Mon, 31 Jul 2017 08:24:10 +0300 Subject: [PATCH] revert weaponselect --- src/hacks/FollowBot.cpp | 4 ++-- src/hacks/Walkbot.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 898f292e..878f0b32 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -247,13 +247,13 @@ void DoWalking() { // If the local player is a medic and user settings allow, then keep the medigun out if (g_pLocalPlayer->clazz == tf_medic && always_medigun) { if (my_slot != 1) { - g_pUserCmd->weaponselect = 1; + g_IEngine->ExecuteClientCmd("slot2"); } // Else we attemt to keep our weapon mimiced with our follow target } else { if (my_slot != owner_slot) { - g_pUserCmd->weaponselect = owner_slot; + g_IEngine->ExecuteClientCmd(format("slot", owner_slot + 1).c_str()); } } } diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index df73fb78..bd12d78e 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -698,7 +698,7 @@ void UpdateSlot() { if (vfunc(weapon, 190, 0)(weapon)) { int slot = vfunc(weapon, 395, 0)(weapon); if (slot != int(force_slot) - 1) { - g_pUserCmd->weaponselect = int(force_slot) - 1; + hack::ExecuteCommand(format("slot", int(force_slot))); } } }