From: Mario Date: Sat, 18 Jun 2016 22:51:14 +0000 (+1000) Subject: Optimize it further by making the engine do the distance checking X-Git-Tag: xonotic-v0.8.2~791 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bcb3e59286052e18b1cbe2606878f554589cc646;p=xonotic%2Fxonotic-data.pk3dir.git Optimize it further by making the engine do the distance checking --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 4263bc3b3..0bdd2f19e 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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);