From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Fri, 26 May 2023 06:11:31 +0000 (+0200) Subject: add waypoints for battle royale supply and vehicle drop event X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2726dba65c5dbc08c3f2302673e25174a90442aa;p=xonotic%2Fxonotic-data.pk3dir.git add waypoints for battle royale supply and vehicle drop event --- diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index 2e0085cc4..4ce1f29d3 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -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; } diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_events.qc b/qcsrc/common/gamemodes/gamemode/br/sv_events.qc index 766b12d7d..b5c8a46a9 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_events.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_events.qc @@ -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 diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 6c8af6234..76237339c 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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;