From 0c5d2c85f158bf156d3b212b64ad41a1e0fc2e01 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 5 Jun 2020 08:36:12 +1000 Subject: [PATCH] Optionally play a respawning sound twice before an item actually respawns (enabled by default) --- qcsrc/common/t_items.qc | 6 ++++++ qcsrc/server/autocvars.qh | 1 + xonotic-server.cfg | 1 + 3 files changed, 8 insertions(+) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 37cb77a7a..a0a97b148 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -558,6 +558,12 @@ void Item_RespawnThink(entity this) if(time >= this.wait) Item_Respawn(this); + else if(autocvar_g_items_respawnpulses) + { + float finished = this.wait - time; + if(finished < 3 && finished >= 1 && floor(finished - frametime) != floor(finished)) // at least 2 seconds remain until the item will respawn + sound(this, CH_TRIGGER, SND_ITEMRESPAWNCOUNTDOWN, VOL_BASE, ATTEN_NORM); + } } void Item_ScheduleRespawnIn(entity e, float t) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 99077dcfe..3ee055be1 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -182,6 +182,7 @@ bool autocvar_g_nodepthtestplayers; bool autocvar_g_norecoil; float autocvar_g_items_mindist; float autocvar_g_items_maxdist; +bool autocvar_g_items_respawnpulses = true; int autocvar_g_pickup_items; float autocvar_g_player_alpha; float autocvar_g_player_brightness; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index c7b63f536..be773c5ea 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -225,6 +225,7 @@ set g_maplist_ignore_sizes 0 "when 1, all maps are shown in the map list regardl set g_maplist_sizes_count_maxplayers 1 "check the player limit when getting the player count so forced spectators don't affect the size restrictions" set g_maplist_sizes_count_bots 1 "include the number of bots currently in the server when counting the number of players for size restrictions" +set g_items_respawnpulses 1 "play a pulsing sound effect when items are about to respawn" set g_items_mindist 4000 "starting distance for the fading of items" set g_items_maxdist 4500 "maximum distance at which an item can be viewed, after which it will be invisible" -- 2.39.2