]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean up racer target locking trace
authorMario <mario@smbclan.net>
Wed, 6 Jul 2016 04:16:00 +0000 (14:16 +1000)
committerMario <mario@smbclan.net>
Wed, 6 Jul 2016 04:16:00 +0000 (14:16 +1000)
qcsrc/common/vehicles/vehicle/racer.qc

index 9c0f40210cc9b8d063c296d811730277fd4dd8fe..334320b3214542c438cbbae8f76c8491d3f7c9d4 100644 (file)
@@ -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)
                {