]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optionally play a respawning sound twice before an item actually respawns (enabled... Mario/respawn_pulses
authorMario <mario.mario@y7mail.com>
Thu, 4 Jun 2020 22:36:12 +0000 (08:36 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 4 Jun 2020 22:36:12 +0000 (08:36 +1000)
qcsrc/common/t_items.qc
qcsrc/server/autocvars.qh
xonotic-server.cfg

index 37cb77a7a2c1d3372d2cada530968afbf663a6a3..a0a97b148c2b9e5a8a4f1c189068d8145f24b8b5 100644 (file)
@@ -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)
index 99077dcfe7b237fc8e1c5e59f888e6d666c4feb5..3ee055be1184d8e8a895de9063ab82159f56ac19 100644 (file)
@@ -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;
index c7b63f536cafb6cb442c89bd17d6716295c8f31b..be773c5eab4fc8601fba902f06a65efc9a91e747 100644 (file)
@@ -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"