summaryrefslogtreecommitdiff
path: root/internal_rewrite
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-09-02 16:55:27 +0200
committernavewindre <boneyaard@gmail.com>2018-09-02 16:55:27 +0200
commita988afb947e653b96f2b188d455865cd6fc80ea0 (patch)
tree29d1cdd2da78632f3944d426cea566b0efe7fd68 /internal_rewrite
parentce327351a910dbc7f899aabac2e08cad0a2102e9 (diff)
yea
Diffstat (limited to 'internal_rewrite')
-rw-r--r--internal_rewrite/internal_rewrite.vcxproj2
-rw-r--r--internal_rewrite/override_view.cpp2
-rw-r--r--internal_rewrite/ragebot.cpp13
-rw-r--r--internal_rewrite/settings.hpp2
-rw-r--r--internal_rewrite/ui.h8
-rw-r--r--internal_rewrite/ui_dropdown_item.h6
-rw-r--r--internal_rewrite/visual_player.cpp31
7 files changed, 43 insertions, 21 deletions
diff --git a/internal_rewrite/internal_rewrite.vcxproj b/internal_rewrite/internal_rewrite.vcxproj
index 995987b..bd3e6dc 100644
--- a/internal_rewrite/internal_rewrite.vcxproj
+++ b/internal_rewrite/internal_rewrite.vcxproj
@@ -312,7 +312,7 @@
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
- <AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalOptions>/std:c++latest /Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions>_WINDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>precompiled.hpp</PrecompiledHeaderFile>
diff --git a/internal_rewrite/override_view.cpp b/internal_rewrite/override_view.cpp
index c379c27..9a2e972 100644
--- a/internal_rewrite/override_view.cpp
+++ b/internal_rewrite/override_view.cpp
@@ -9,7 +9,7 @@ void __fastcall hooks::override_view( void* ecx_, void* edx_, CViewSetup* setup
}
g_ctx.m_fov = setup->m_flFov;
- if ( g_ctx.run_frame( ) && g_ctx.m_local->is_valid( ) && ( !g_ctx.m_local->m_bIsScoped( ) || g_settings.misc.no_zoom( ) )) {
+ if ( g_ctx.run_frame( ) && g_ctx.m_local->is_valid( ) && ( !g_ctx.m_local->m_bIsScoped( ) || g_settings.misc.no_zoom( ) ) ) {
setup->m_flFov = g_settings.misc.fov_changer( );
}
g_cheat.m_extra.thirdperson( );
diff --git a/internal_rewrite/ragebot.cpp b/internal_rewrite/ragebot.cpp
index e82602d..351e525 100644
--- a/internal_rewrite/ragebot.cpp
+++ b/internal_rewrite/ragebot.cpp
@@ -784,9 +784,12 @@ namespace features
aim_angle = math::vector_angles( local_pos, aim_pos ).clamp( );
+ if( g_settings.rage.active->m_auto_stop( ) == 2 )
+ quick_stop( m_cmd );
+
if( !util::hitchance( it, aim_angle,
g_settings.rage.active->m_hitchance ) ) {
- if( g_settings.rage.active->m_auto_stop( ) )
+ if( g_settings.rage.active->m_auto_stop( ) == 1 )
quick_stop( m_cmd );
if( g_settings.rage.auto_scope( ) && g_ctx.m_local->get_weapon( )->is_sniper( ) ) {
@@ -849,7 +852,9 @@ namespace features
vec3_t comp = math::vector_angles( vec3_t( ), spread_dir );
m_cmd->m_viewangles = comp;
- m_cmd->m_random_seed = seed;
+ }
+ else {
+ m_cmd->m_viewangles = angles;
}
if( g_settings.rage.silent == 2 ) {
@@ -862,7 +867,6 @@ namespace features
g_cheat.m_lagmgr.set_state( !g_cheat.m_lagmgr.get_sent( ) );
}
- m_cmd->m_viewangles = angles;
if( !g_settings.rage.silent( ) ) {
g_csgo.m_engine( )->SetViewAngles( m_cmd->m_viewangles );
}
@@ -971,6 +975,9 @@ namespace features
}
set_angles( angle.clamp( ) );
+
+ if( g_settings.rage.active->m_auto_stop && !g_settings.rage.compensate_spread( ) )
+ quick_stop( m_cmd );
}
void c_ragebot::run( ) {
diff --git a/internal_rewrite/settings.hpp b/internal_rewrite/settings.hpp
index 5f38c8b..1ac1608 100644
--- a/internal_rewrite/settings.hpp
+++ b/internal_rewrite/settings.hpp
@@ -56,7 +56,7 @@ namespace data
con_var< int > m_delay_type{ this, fnv( "delay_type" ), 0 };
con_var< bool > m_spread_limit{ this, fnv( "spread_limit" ), 0 };
con_var< int > m_spread_limit_min{ this, fnv( "spread_limit_min" ), 100 };
- con_var< bool > m_auto_stop{ this, fnv( "auto_stop" ), false };
+ con_var< int > m_auto_stop{ this, fnv( "auto_stop" ), false };
con_var< float > m_hitbox_scale{ this, fnv( "point_scale" ), 0.5f };
};
diff --git a/internal_rewrite/ui.h b/internal_rewrite/ui.h
index 3dfb551..122232e 100644
--- a/internal_rewrite/ui.h
+++ b/internal_rewrite/ui.h
@@ -232,7 +232,7 @@ namespace ui
auto general_form = std::make_shared< ui::c_form >( 0, 0, 215, 306, xors( "weapon specific" ), 306 ); {
general_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "category" ), &current_category, &dropdowns::weapon_configs ) );
- general_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "auto stop" ), &g_settings.rage.general.m_auto_stop ) );
+ general_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "auto stop" ), &g_settings.rage.general.m_auto_stop, &dropdowns::auto_stop ) );
general_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "spread limit" ), &g_settings.rage.general.m_spread_limit )
)->set_cond( [ ]( ) { return !g_settings.rage.compensate_spread; } );
@@ -261,7 +261,7 @@ namespace ui
auto pistols_form = std::make_shared< ui::c_form >( 0, 0, 215, 306, xors( "weapon specific" ), 306 ); {
pistols_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "category" ), &current_category, &dropdowns::weapon_configs ) );
- pistols_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "auto stop" ), &g_settings.rage.heavy_pistols.m_auto_stop ) );
+ pistols_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "auto stop" ), &g_settings.rage.heavy_pistols.m_auto_stop, &dropdowns::auto_stop ) );
pistols_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "spread limit" ), &g_settings.rage.heavy_pistols.m_spread_limit )
)->set_cond( [ ]( ) { return !g_settings.rage.compensate_spread; } );
@@ -289,7 +289,7 @@ namespace ui
auto snipers_form = std::make_shared< ui::c_form >( 0, 0, 215, 306, xors( "weapon specific" ), 306 ); {
snipers_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "category" ), &current_category, &dropdowns::weapon_configs ) );
- snipers_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "auto stop" ), &g_settings.rage.snipers.m_auto_stop ) );
+ snipers_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "auto stop" ), &g_settings.rage.snipers.m_auto_stop, &dropdowns::auto_stop ) );
snipers_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "spread limit" ), &g_settings.rage.snipers.m_spread_limit )
)->set_cond( [ ]( ) { return !g_settings.rage.compensate_spread; } );
@@ -317,7 +317,7 @@ namespace ui
auto auto_form = std::make_shared< ui::c_form >( 0, 0, 215, 306, xors( "weapon specific" ), 306 ); {
auto_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "category" ), &current_category, &dropdowns::weapon_configs ) );
- auto_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "auto stop" ), &g_settings.rage.auto_snipers.m_auto_stop ) );
+ auto_form->add_item( std::make_shared< ui::c_dropdown< > >( 0, 0, 120, xors( "auto stop" ), &g_settings.rage.auto_snipers.m_auto_stop, &dropdowns::auto_stop ) );
auto_form->add_item( std::make_shared< ui::c_checkbox >( 0, 0, xors( "spread limit" ), &g_settings.rage.auto_snipers.m_spread_limit )
)->set_cond( [ ]( ) { return !g_settings.rage.compensate_spread; } );
diff --git a/internal_rewrite/ui_dropdown_item.h b/internal_rewrite/ui_dropdown_item.h
index 0475746..f998254 100644
--- a/internal_rewrite/ui_dropdown_item.h
+++ b/internal_rewrite/ui_dropdown_item.h
@@ -67,6 +67,12 @@ namespace ui
{ xors( "wide angle" ), 3 },
};
+ static std::vector< dropdown_item_t< > > auto_stop = {
+ { xors( "none" ), 0 },
+ { xors( "hitchance" ), 1 },
+ { xors( "full" ), 2 }
+ };
+
static std::vector< dropdown_item_t< > > antiaim_edge = {
{ xors( "off" ), 0 },
{ xors( "peek" ), 1 },
diff --git a/internal_rewrite/visual_player.cpp b/internal_rewrite/visual_player.cpp
index eee2065..a1089e7 100644
--- a/internal_rewrite/visual_player.cpp
+++ b/internal_rewrite/visual_player.cpp
@@ -47,15 +47,12 @@ namespace features
if( !g_settings.visuals.hitmarkers || !g_ctx.run_frame( ) )
return;
- static const clr_t col_start = clr_t( 231, 75, 75, 255 );
- static const clr_t col_end = clr_t( 0xf4, 0x7c, 0xa8, 255 );
-
float delta = ( g_csgo.m_globals->m_curtime - m_last_hit ) * 1.5f;
if( std::abs( delta ) > 1.0f ) return;
- clr_t blend = clr_t::blend( col_start, col_end, delta );
+ clr_t col = clr_t( 221, 221, 221, 255 );
if( delta > 0.75f ) {
- blend.a( ) = 255 * ( 1.0f - delta ) * 4.f;
+ col.a( ) = 255 * ( 1.0f - delta ) * 4.f;
}
auto get_rotated_point = [ ]( vec2_t point, float rotation, float distance ) {
@@ -72,14 +69,26 @@ namespace features
float rotation = 135.f + i * 90.f;
vec2_t center = { screen_w * 0.5f, screen_h * 0.5f };
- vec2_t start = get_rotated_point( center, rotation, 8.f );
- vec2_t end = get_rotated_point( center, rotation, 17.f );
+
+ for( size_t dist = 7; dist < 14; ++dist ) {
+ vec2_t start = get_rotated_point( center, rotation, dist );
+ vec2_t end = get_rotated_point( center, rotation, dist + 1 );
+
+ vec2_t rot_start = get_rotated_point( center, rotation - 180.f, dist );
+ vec2_t rot_end = get_rotated_point( center, rotation - 180.f, dist + 1 );
+
+ int point = dist - 6;
+ float percentage = point / 7;
- vec2_t rot_start = get_rotated_point( center, rotation - 180.f, 8.f );
- vec2_t rot_end = get_rotated_point( center, rotation - 180.f, 17.f );
+ percentage = 1.f - percentage;
+ percentage *= std::clamp( delta + 0.75f, 0.f, 1.f );
- draw_line( start, end, blend );
- draw_line( rot_start, rot_end, blend );
+ clr_t draw = col;
+ draw.a( ) *= percentage;
+
+ draw_line( start, end, draw );
+ draw_line( rot_start, rot_end, draw );
+ }
}
}