From 39f70b7b843d926eeb534ac1de25cc38b13c493d Mon Sep 17 00:00:00 2001 From: navewindre Date: Mon, 3 Sep 2018 23:48:51 +0200 Subject: ah --- internal_rewrite/context.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'internal_rewrite/context.cpp') diff --git a/internal_rewrite/context.cpp b/internal_rewrite/context.cpp index cf0f9ee..421bc06 100644 --- a/internal_rewrite/context.cpp +++ b/internal_rewrite/context.cpp @@ -22,6 +22,7 @@ void c_context::on_cmove_end( user_cmd_t* cmd ) { if( send ) { m_last_fakeangle = cmd->m_viewangles; + m_last_origin = m_local->m_vecOrigin( ); } else { @@ -53,8 +54,6 @@ void c_context::on_cmove_end( user_cmd_t* cmd ) { m_last_shot %= 128; m_shot_data[ m_last_shot ] = new_shot; - - //g_con->log( "incrementing shots( in attack )" ); m_has_incremented_shots = true; } @@ -62,9 +61,12 @@ void c_context::on_cmove_end( user_cmd_t* cmd ) { } } - weapon_info_t* wpn_info = m_local->get_weapon( )->get_wpn_info( ); - if( wpn_info && m_has_fired_this_frame ) - m_local->get_weapon( )->m_flNextPrimaryAttack( ) += wpn_info->cycle_time; + auto wep = m_local->get_weapon( ); + if( wep ) { + weapon_info_t* wpn_info = m_local->get_weapon( )->get_wpn_info( ); + if( wpn_info && m_has_fired_this_frame ) + m_local->get_weapon( )->m_flNextPrimaryAttack( ) += wpn_info->cycle_time; + } if( g_settings.misc.log_hits( ) ) { for( auto& it : m_shot_data ) { -- cgit v1.2.3