From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Tue, 23 May 2023 11:43:22 +0000 (+0200) Subject: improve compatibility between battle royale squads and vehicles X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f8ddfd98686e9700ead11fd9aafa5318910b9071;p=xonotic%2Fxonotic-data.pk3dir.git improve compatibility between battle royale squads and vehicles --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 343cad659..6cc3fdafd 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -126,6 +126,9 @@ void vehicles_locktarget(entity this, float incr, float decr, float _lock_time) if(SAME_TEAM(trace_ent, this)) trace_ent = NULL; + if(SAME_SQUAD(trace_ent, this)) + trace_ent = NULL; + if(IS_DEAD(trace_ent)) trace_ent = NULL; @@ -964,7 +967,7 @@ void vehicles_enter(entity pl, entity veh) if(autocvar_g_vehicles_enter) // vehicle's touch function should handle this if entering via use key is disabled (TODO) if(veh.vehicle_flags & VHF_MULTISLOT) - if(veh.owner && SAME_TEAM(pl, veh)) + if(veh.owner && ((!IS_GAMETYPE(BR) && SAME_TEAM(pl, veh)) || (IS_GAMETYPE(BR) && SAME_SQUAD(pl, veh)))) { // we don't need a return value or anything here // if successful the owner check below will prevent anything weird diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 8b34473e3..d4d7a27ec 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -363,7 +363,8 @@ bool vehicles_valid_pilot(entity this, entity toucher) if((!IS_PLAYER(toucher)) || (IS_DEAD(toucher)) || (toucher.vehicle) - || (DIFF_TEAM(toucher, this)) + || (!IS_GAMETYPE(BR) && DIFF_TEAM(toucher, this)) + || (IS_GAMETYPE(BR) && DIFF_SQUAD(toucher, this)) ) { return false; } return true;