-
Notifications
You must be signed in to change notification settings - Fork 42
/
boner.cpp
70 lines (52 loc) · 1.69 KB
/
boner.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
68
69
70
#include "boner.h"
#include "context.h"
#include "playerlist.h"
#include "anims.h"
c_boner g_boner;
void c_boner::update()
{
memset( valid_bone_matrix, 0, 65 );
if ( !ctx.m_local )
return;
matrix3x4_t temp_matrix[128];
for ( int i = 1; i < 65; i++ )
{
c_base_entity* ent = csgo.m_entity_list( )->get_entity( i );
if ( !ent )
continue;
if ( ent == ctx.m_local )
continue;
if ( ent->dormant( ) || !ent->alive( ) )
continue;
if ( ctx.m_settings.rage_aimbot_enabled )
{
ent->fuck_ik( );
ent->set_abs_origin( ent->origin( ) );
}
ent->invalidate_bone_cache( );
valid_bone_matrix[i] = ent->setup_bones( temp_matrix, 128, BONE_USED_BY_ANYTHING, ent->simulation_time( ) );
mutex[i].lock( );
memcpy( latest_bone_matrix[i], temp_matrix, sizeof( matrix3x4_t ) * 128 );
mutex[i].unlock( );
}
}
void c_boner::update_local( )
{
if ( !ctx.m_local || !ctx.m_local->alive( ) )
return;
if ( !csgo.m_input( )->m_fCameraInThirdPerson )
return;
int i = ctx.m_local->index( );
matrix3x4_t temp_matrix[128];
// dirty way of setting angles
// pitch here is model rotation, not actual body pitch ( body pitch is stored in pose parameters )
vec3 o_abs_angles = *(vec3*)( (uintptr_t)ctx.m_local + 0xC4 );
*(float*)( (uintptr_t)ctx.m_local + 0xC4 ) = 0.f;
*(float*)( (uintptr_t)ctx.m_local + 0xC8 ) = g_anims.local_data( )->m_real_angle.y;
ctx.m_local->invalidate_bone_cache( );
valid_bone_matrix[i] = ctx.m_local->setup_bones( temp_matrix, 128, BONE_USED_BY_ANYTHING, ctx.m_local->simulation_time( ) );
mutex[i].lock( );
memcpy( latest_bone_matrix[i], temp_matrix, sizeof( matrix3x4_t ) * 128 );
mutex[i].unlock( );
*(vec3*)( (uintptr_t)ctx.m_local + 0xC4 ) = o_abs_angles;
}