From: Mario Date: Wed, 6 Jul 2016 04:16:00 +0000 (+1000) Subject: Clean up racer target locking trace X-Git-Tag: xonotic-v0.8.2~700^2~94 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4b2c4851f320c96e1fd51953ccb604ddd1a5cb7b;p=xonotic%2Fxonotic-data.pk3dir.git Clean up racer target locking trace --- diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 9c0f40210..334320b32 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -199,12 +199,6 @@ bool racer_frame(entity this) PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false; - if(time >= vehic.vehicle_last_trace) - { - crosshair_trace(this); - vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate; - } - vehic.angles_x *= -1; // Yaw @@ -337,10 +331,16 @@ bool racer_frame(entity this) if(autocvar_g_vehicle_racer_rocket_locktarget) { - if(vehic.vehicle_last_trace == time + autocvar_g_vehicle_racer_thinkrate) - vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime, - (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime, - autocvar_g_vehicle_racer_rocket_locked_time); + if(time >= vehic.vehicle_last_trace) + { + crosshair_trace(this); + + vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime, + (1 / autocvar_g_vehicle_racer_rocket_locking_releasetime) * frametime, + autocvar_g_vehicle_racer_rocket_locked_time); + + vehic.vehicle_last_trace = time + autocvar_g_vehicle_racer_thinkrate; + } if(vehic.lock_target) {