]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize it further by making the engine do the distance checking
authorMario <mario@smbclan.net>
Sat, 18 Jun 2016 22:51:14 +0000 (08:51 +1000)
committerMario <mario@smbclan.net>
Sat, 18 Jun 2016 22:51:14 +0000 (08:51 +1000)
qcsrc/server/cl_client.qc

index 4263bc3b31cc99495ebc7b534f746b10a2480a8a..0bdd2f19e78e83ca5bf410736ca97f73515c17b2 100644 (file)
@@ -2158,10 +2158,9 @@ void PlayerPreThink ()
        if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !gameover && !this.vehicle)
        if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this))
        {
-               FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE,
+               FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it),
                {
                        if(!IS_DEAD(it) && it.takedamage != DAMAGE_NO)
-                       if(vdist(it.origin - this.origin, <, autocvar_g_vehicles_enter_radius))
                        if((it.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(it.owner, this))
                        {
                                Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_VEHICLE_ENTER_GUNNER);