summaryrefslogtreecommitdiff
path: root/internal_rewrite/context.cpp
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2018-09-03 23:48:51 +0200
committernavewindre <boneyaard@gmail.com>2018-09-03 23:48:51 +0200
commit39f70b7b843d926eeb534ac1de25cc38b13c493d (patch)
tree654ac4c96dd9fb2355998d63ad866a3b52c71632 /internal_rewrite/context.cpp
parenta988afb947e653b96f2b188d455865cd6fc80ea0 (diff)
ah
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 ) {