]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add waypoints for battle royale supply and vehicle drop event
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 26 May 2023 06:11:31 +0000 (08:11 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Fri, 26 May 2023 06:11:31 +0000 (08:11 +0200)
qcsrc/common/gamemodes/gamemode/br/sv_br.qc
qcsrc/common/gamemodes/gamemode/br/sv_events.qc
qcsrc/common/vehicles/sv_vehicles.qc

index 2e0085cc4d40f71703132ab7e4c4582a408a4d50..4ce1f29d31c9cc99ff67f515c5a23f47d1ea0647 100644 (file)
@@ -976,7 +976,7 @@ MUTATOR_HOOKFUNCTION(br, CustomizeWaypoint)
     if((wp == wp.owner.br_allywaypoint) && (vdist(wp.owner.origin - player.origin, <, autocvar_g_br_squad_waypoint_distance) || STAT(BLEEDING, wp.owner)))
         return true;
 
-    if(!IS_PLAYER(player) || DIFF_SQUAD(wp.owner, player))
+    if(!IS_PLAYER(player) || (IN_SQUAD(wp.owner) && DIFF_SQUAD(wp.owner, player)))
         return true;
 }
 
index 766b12d7ddcaccdeaad9c99b7e8f6f1f48c4b2cc..b5c8a46a908c90ed5c1adae835f42b0f7bd692e3 100644 (file)
@@ -12,6 +12,25 @@ void spawn_supply()
     {
         delete(this);
         LOG_WARN("supply drop failed");
+        return;
+    }
+
+    entity wi = REGISTRY_GET(Weapons, this.weapon);
+    entity ii = this.itemdef;
+
+    if (wi != WEP_Null)
+    {
+        entity wp = WaypointSprite_Spawn(WP_Weapon, autocvar_g_br_supply_interval, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Weapon);
+        wp.wp_extra = wi.m_id;
+    }
+    else if (ii != NULL)
+    {
+        entity wp = WaypointSprite_Spawn(WP_Item, autocvar_g_br_supply_interval, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Item);
+        wp.wp_extra = ii.m_id;
+    }
+    else
+    {
+        LOG_WARN("supply drop has no waypoint");
     }
 }
 
@@ -28,7 +47,11 @@ void spawn_vehicle()
     {
         delete(this);
         LOG_WARN("vehicle drop failed");
+        return;
     }
+
+    entity wp = WaypointSprite_Spawn(WP_Vehicle, autocvar_g_br_vehicle_interval, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Vehicle);
+    wp.wp_extra = this.vehicleid;
 }
 
 // TODO: ensure spawn is within ring
index 6c8af6234e5157fdd3d240a4461772c4b0d92fb2..76237339cb1ef128fe3728f5780f4a8d38b46d36 100644 (file)
@@ -1000,6 +1000,9 @@ void vehicles_enter(entity pl, entity veh)
        }
        else return;
 
+       if(veh.br_vehicle_drop && veh.waypointsprite_attached)
+               WaypointSprite_Kill(veh.waypointsprite_attached);
+
        RemoveGrapplingHooks(pl);
 
        veh.vehicle_ammo1 = 0;