]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't run think on idle vehicles every server frame
authorMario <mario@smbclan.net>
Sun, 19 Jun 2016 00:10:52 +0000 (10:10 +1000)
committerMario <mario@smbclan.net>
Sun, 19 Jun 2016 00:10:52 +0000 (10:10 +1000)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qh
qcsrc/common/vehicles/vehicle/raptor.qc

index 6eca93643c7eb59f44725fe1df20d701c50fcef8..9ef5e4604c83170d35c6fec77b7e9b4eeacd3e9e 100644 (file)
@@ -1011,7 +1011,7 @@ void vehicles_enter(entity pl, entity veh)
 
 void vehicles_think(entity this)
 {
-       this.nextthink = time;
+       this.nextthink = time + autocvar_g_vehicles_thinkrate;
 
        if(this.owner)
                this.owner.vehicle_weapon2mode = this.vehicle_weapon2mode;
index eded4f90bf4837be143e75e6e531eb20430bb07b..e593922fcb0f4beb788cc77ad65d1b0bf754cca2 100644 (file)
@@ -17,6 +17,7 @@ bool autocvar_g_vehicles_delayspawn = true;
 float autocvar_g_vehicles_delayspawn_jitter = 10;
 float autocvar_g_vehicles_allow_bots;
 int autocvar_g_vehicles_exit_attempts = 25;
+float autocvar_g_vehicles_thinkrate = 0.1;
 
 AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles");
 float autocvar_g_vehicles_teleportable;
index fe381d3c631b70fb8353b1d02372b38f6ce03315..59510c78f069e7e4d6d22787af5f5171d6560f4a 100644 (file)
@@ -178,7 +178,7 @@ bool raptor_frame(entity this)
                vehic.sound_nexttime = time + 7.955812;
                //sound (vehic.tur_head, CH_TRIGGER_SINGLE, SND_VEH_RAPTOR_FLY, 1 - ftmp,   ATTEN_NORM );
                sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_RAPTOR_SPEED, 1, ATTEN_NORM);
-               vehic.wait = ftmp;
+               vehic.wait = 0;
        }
        /*
        else if(fabs(ftmp - vehic.wait) > 0.2)