-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProxies.h
93 lines (85 loc) · 3.1 KB
/
Proxies.h
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
#include "Skins.h"
#include "Entities.h"
#include "Interfaces.h"
#include "ClientRecvProps.h"
RecvVarProxyFn fnSequenceProxyFn = NULL;
void SetViewModelSequence(const CRecvProxyData *pDataConst, void *pStruct, void *pOut)
{
CRecvProxyData* pData = const_cast<CRecvProxyData*>(pDataConst);
CBaseViewModel* pViewModel = (CBaseViewModel*)pStruct;
if (pViewModel) {
IClientEntity* pOwner = Interfaces::EntList->GetClientEntityFromHandle(HANDLE(pViewModel->GetOwner()));
if (pOwner && pOwner->GetIndex() == Interfaces::Engine->GetLocalPlayer()) {
void* pModel = Interfaces::ModelInfo->GetModel(pViewModel->GetModelIndex());
const char* szModel = Interfaces::ModelInfo->GetModelName(pModel);
int m_nSequence = pData->m_Value.m_Int;
if (!strcmp(szModel, "models/weapons/v_knife_butterfly.mdl"))
{
// Fix animations for the Butterfly Knife.
switch (m_nSequence) {
case SEQUENCE_DEFAULT_DRAW:
m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_DRAW, SEQUENCE_BUTTERFLY_DRAW2); break;
case SEQUENCE_DEFAULT_LOOKAT01:
m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_LOOKAT01, SEQUENCE_BUTTERFLY_LOOKAT03); break;
default:
m_nSequence++;
}
}
else if (!strcmp(szModel, "models/weapons/v_knife_falchion_advanced.mdl"))
{
// Fix animations for the Falchion Knife.
switch (m_nSequence) {
case SEQUENCE_DEFAULT_IDLE2:
m_nSequence = SEQUENCE_FALCHION_IDLE1; break;
case SEQUENCE_DEFAULT_HEAVY_MISS1:
m_nSequence = RandomInt(SEQUENCE_FALCHION_HEAVY_MISS1, SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP); break;
case SEQUENCE_DEFAULT_LOOKAT01:
m_nSequence = RandomInt(SEQUENCE_FALCHION_LOOKAT01, SEQUENCE_FALCHION_LOOKAT02); break;
case SEQUENCE_DEFAULT_DRAW:
case SEQUENCE_DEFAULT_IDLE1:
break;
default:
m_nSequence--;
}
}
else if (!strcmp(szModel, "models/weapons/v_knife_push.mdl"))
{
// Fix animations for the Shadow Daggers.
switch (m_nSequence) {
case SEQUENCE_DEFAULT_IDLE2:
m_nSequence = SEQUENCE_DAGGERS_IDLE1; break;
case SEQUENCE_DEFAULT_LIGHT_MISS1:
case SEQUENCE_DEFAULT_LIGHT_MISS2:
m_nSequence = RandomInt(SEQUENCE_DAGGERS_LIGHT_MISS1, SEQUENCE_DAGGERS_LIGHT_MISS5); break;
case SEQUENCE_DEFAULT_HEAVY_MISS1:
m_nSequence = RandomInt(SEQUENCE_DAGGERS_HEAVY_MISS2, SEQUENCE_DAGGERS_HEAVY_MISS1); break;
case SEQUENCE_DEFAULT_HEAVY_HIT1:
case SEQUENCE_DEFAULT_HEAVY_BACKSTAB:
case SEQUENCE_DEFAULT_LOOKAT01:
m_nSequence += 3; break;
case SEQUENCE_DEFAULT_DRAW:
case SEQUENCE_DEFAULT_IDLE1:
break;
default:
m_nSequence += 2;
}
}
else if (!strcmp(szModel, "models/weapons/v_knife_survival_bowie.mdl"))
{
// Fix animations for the Bowie Knife.
switch (m_nSequence) {
case SEQUENCE_DEFAULT_DRAW:
case SEQUENCE_DEFAULT_IDLE1:
break;
case SEQUENCE_DEFAULT_IDLE2:
m_nSequence = SEQUENCE_BOWIE_IDLE1; break;
default:
m_nSequence--;
}
}
pData->m_Value.m_Int = m_nSequence;
}
}
fnSequenceProxyFn(pData, pStruct, pOut);
}