]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
improve compatibility between battle royale squads and vehicles
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 May 2023 11:43:22 +0000 (13:43 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Tue, 23 May 2023 11:43:22 +0000 (13:43 +0200)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc

index 343cad6591da170f36e7eafe148dddf873b4c536..6cc3fdafd8d18d9f3214fc767568b18ca2e7b8fb 100644 (file)
@@ -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
index 8b34473e398a5894256e386200459a00eec45ada..d4d7a27ecb15cd8344b254d6131a47dbc45beac7 100644 (file)
@@ -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;