diff options
Diffstat (limited to 'internal_rewrite/visual_local.cpp')
| -rw-r--r-- | internal_rewrite/visual_local.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/internal_rewrite/visual_local.cpp b/internal_rewrite/visual_local.cpp index dc311c0..88e9c60 100644 --- a/internal_rewrite/visual_local.cpp +++ b/internal_rewrite/visual_local.cpp @@ -122,11 +122,7 @@ namespace features int min_dist = 64;
int max_ticks = g_settings.rage.fakelag.ticks;
max_ticks += g_settings.rage.fakelag.fluctuate * max_ticks * 0.01f;
-#ifdef _DEBUG
max_ticks = std::min( max_ticks, 16 );
-#else
- max_ticks = std::min( max_ticks, 14 );
-#endif
float speed = g_ctx.m_local->m_vecVelocity( ).length2d( );
bool breaking = g_cheat.m_lagmgr.is_breaking_lc( );
@@ -142,9 +138,29 @@ namespace features g_ctx.m_local->m_bIsScoped( ) ) {
int w, h;
g_csgo.m_engine( )->GetScreenSize( w, h );
+
+ auto wep = g_ctx.m_local->get_weapon( );
+ if( wep ) {
+ float inacc = g_ctx.m_weapon_inaccuracy;
+
+ int pixels = inacc * 75;
+
+ if( pixels < 2 ) {
+ draw_line( 0, h / 2, w, h / 2, clr_t( 0, 0, 0 ) );
+ draw_line( w / 2, 0, w / 2, h, clr_t( 0, 0, 0 ) );
+ }
+ else {
+ for( int i = -pixels; i < pixels; ++i ) {
+ float a = 1.f - ( float )( std::abs( i ) ) / ( float )( pixels );
- draw_line( 0, h / 2, w, h / 2, clr_t( 0, 0, 0 ) );
- draw_line( w / 2, 0, w / 2, h, clr_t( 0, 0, 0 ) );
+ float inacc_alpha = 1.f - ( inacc * 3.f );
+ inacc_alpha = std::clamp( inacc_alpha, 0.4f, 1.f );
+
+ draw_line( 0, h / 2 + i, w, h / 2 + i, clr_t( 0, 0, 0, 255 * a * inacc_alpha ) );
+ draw_line( w / 2 + i, 0, w / 2 + i, h, clr_t( 0, 0, 0, 255 * a * inacc_alpha ) );
+ }
+ }
+ }
}
draw_autowall( );
|
