From 8b6980c45f007f2f7bfb5ce68e8e342e98668267 Mon Sep 17 00:00:00 2001 From: aUniqueUser Date: Thu, 31 Dec 2020 13:21:40 -0500 Subject: [PATCH] Fix a autoitem and a chams bug --- src/hacks/AutoItem.cpp | 6 +++--- src/hooks/visual/DrawModelExecute.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hacks/AutoItem.cpp b/src/hacks/AutoItem.cpp index b7c36d3b..c7b17db1 100644 --- a/src/hacks/AutoItem.cpp +++ b/src/hacks/AutoItem.cpp @@ -145,6 +145,9 @@ static bool equipItem(int clazz, int slot, int id, bool get = true, bool allowRe slot = 6; } + if (id == -1) + return invmng->EquipItemInLoadout(clazz, slot, -1); + if (get) { auto item_view = inv->GetFirstItemOfItemDef(id); @@ -154,9 +157,6 @@ static bool equipItem(int clazz, int slot, int id, bool get = true, bool allowRe return false; } } - if (id == -1) - return invmng->EquipItemInLoadout(clazz, slot, -1); - auto item_view = inv->GetFirstItemOfItemDef(id); if (item_view) return invmng->EquipItemInLoadout(clazz, slot, item_view->UUID()); diff --git a/src/hooks/visual/DrawModelExecute.cpp b/src/hooks/visual/DrawModelExecute.cpp index 22efa53a..dea2f864 100644 --- a/src/hooks/visual/DrawModelExecute.cpp +++ b/src/hooks/visual/DrawModelExecute.cpp @@ -259,8 +259,8 @@ bool ShouldRenderChams(IClientEntity *entity) if (entity->entindex() < 0) return false; CachedEntity *ent = ENTITY(entity->entindex()); - if (chamsself && ent->m_IDX == LOCAL_E->m_IDX) - return true; + if (ent->m_IDX == LOCAL_E->m_IDX) + return *chamsself; switch (ent->m_Type()) { case ENTITY_BUILDING: