From 3a77883dbf1cf81caf13c87214696abd888b820c Mon Sep 17 00:00:00 2001 From: z411 Date: Sat, 27 Nov 2021 23:57:27 -0300 Subject: [PATCH] keepaway: Make ball wait configurable --- gamemodes-server.cfg | 1 + qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 17b90c624..9257cd57d 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -410,6 +410,7 @@ set g_keepawayball_effects 0 "Add together the numbers you want: EF_ADDITIVE (32 set g_keepawayball_trail_color 254 "particle trail color from player/ball" set g_keepawayball_damageforcescale 3 "Scale of force which is applied to the ball by weapons/explosions/etc" set g_keepawayball_respawntime 10 "if no one picks up the ball, how long to wait until the ball respawns" +set g_keepawayball_wait 1 "time until the ball can be picked up again after getting dropped" // ========== diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc index 5b40ed02c..f7f8e1043 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc +++ b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc @@ -27,6 +27,7 @@ float autocvar_g_keepaway_score_timeinterval; float autocvar_g_keepawayball_damageforcescale; int autocvar_g_keepawayball_effects; float autocvar_g_keepawayball_respawntime; +float autocvar_g_keepawayball_wait; int autocvar_g_keepawayball_trail_color; bool ka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs on waypoints which are attached to ballcarriers, updates once per frame @@ -179,7 +180,7 @@ void ka_DropEvent(entity player) // runs any time that a player is supposed to l // reset the ball setattachment(ball, NULL, ""); set_movetype(ball, MOVETYPE_BOUNCE); - ball.wait = time + 1; + ball.wait = time + autocvar_g_keepawayball_wait; settouch(ball, ka_TouchEvent); setthink(ball, ka_RespawnBall); ball.nextthink = time + autocvar_g_keepawayball_respawntime; -- 2.39.2