From e384f6e5e5e1a0f17b40b7394d545dc900e018f0 Mon Sep 17 00:00:00 2001 From: ruby0b <106119328+ruby0b@users.noreply.github.com> Date: Tue, 7 Mar 2023 07:23:42 -0800 Subject: [PATCH] fix ttt_quickslot --- CHANGELOG.md | 1 + gamemodes/terrortown/gamemode/client/cl_wepswitch.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 810a9c5dd7..dac903a7b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel - Fixed hotreload of TTT2 roles library by a fresh reinitialization - Fixed a wrong localization line call in roles.lua (by @Satton2) - Fixed +zoom bind +- Fixed ttt_quickslot command ## [v0.11.6b](https://github.com/TTT-2/TTT2/tree/v0.11.6b) (2022-09-25) diff --git a/gamemodes/terrortown/gamemode/client/cl_wepswitch.lua b/gamemodes/terrortown/gamemode/client/cl_wepswitch.lua index 5175803b5a..78e3827ddc 100644 --- a/gamemodes/terrortown/gamemode/client/cl_wepswitch.lua +++ b/gamemodes/terrortown/gamemode/client/cl_wepswitch.lua @@ -256,13 +256,13 @@ end local function QuickSlot(ply, cmd, args) if not IsValid(ply) or not args or #args ~= 1 then return end - local slot = tonumber(args) + local slot = tonumber(args[1]) if not slot then return end local wep = ply:GetActiveWeapon() if not IsValid(wep) then return end - if MakeKindValid(wep.Kind) == slot - 1 then + if MakeKindValid(wep.Kind) == slot then RunConsoleCommand("lastinv") else WSWITCH:SelectAndConfirm(slot)