/
DrawModelExecute.cpp
67 lines (58 loc) · 1.91 KB
/
DrawModelExecute.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Created by Jenny White on 29.04.18.
Copyright (c) 2018 nullworks. All rights reserved.
*/
#include <MiscTemporary.hpp>
#include <settings/Bool.hpp>
#include "HookedMethods.hpp"
static settings::Bool no_arms{ "remove.arms", "false" };
static settings::Bool no_hats{ "remove.hats", "false" };
namespace hooked_methods
{
DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_,
const DrawModelState_t &state,
const ModelRenderInfo_t &info, matrix3x4_t *bone)
{
if (!isHackActive())
return original::DrawModelExecute(this_, state, info, bone);
if (!(spectator_target || no_arms || no_hats ||
(*clean_screenshots && g_IEngine->IsTakingScreenshot()) ||
CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer()))
{
return original::DrawModelExecute(this_, state, info, bone);
}
PROF_SECTION(DrawModelExecute);
if (no_arms || no_hats)
{
if (info.pModel)
{
const char *name = g_IModelInfo->GetModelName(info.pModel);
if (name)
{
std::string sname = name;
if (no_arms && sname.find("arms") != std::string::npos)
{
return;
}
else if (no_hats &&
sname.find("player/items") != std::string::npos)
{
return;
}
}
}
}
IClientUnknown *unk = info.pRenderable->GetIClientUnknown();
if (unk)
{
IClientEntity *ent = unk->GetIClientEntity();
if (ent)
if (ent->entindex() == spectator_target)
return;
if (ent && !effect_chams::g_EffectChams.drawing &&
effect_chams::g_EffectChams.ShouldRenderChams(ent))
return;
}
return original::DrawModelExecute(this_, state, info, bone);
}
} // namespace hooked_methods