summaryrefslogtreecommitdiff
path: root/internal_rewrite/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'internal_rewrite/context.cpp')
-rw-r--r--internal_rewrite/context.cpp12
1 files changed, 7 insertions, 5 deletions
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 ) {