]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
server side option for both (old) or individually silent or particleless (re)spawning
authorDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:10 +0000 (23:47 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:10 +0000 (23:47 +0000)
qcsrc/client/main.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/spawnpoints.qh
xonotic-client.cfg
xonotic-server.cfg

index 90917341a29a67bbc69e9f0cc74a05328015cd0c..8a8e3f39d3e354cf3cf4cbf76d7401975c020fd5 100644 (file)
@@ -875,11 +875,13 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
        {
                this.origin = ReadVector();
 
+               int particlesAndOrSound = ReadByte();
+
                if(is_new)
                {
                        float teamnum = entcs_GetTeam(entnum - 1);
 
-                       if(autocvar_cl_spawn_event_particles)
+                       if(autocvar_cl_spawn_event_particles && (particlesAndOrSound & BIT(0)))
                        {
                                switch(teamnum)
                                {
@@ -890,7 +892,8 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
                                        default: pointparticles(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1); break;
                                }
                        }
-                       if(autocvar_cl_spawn_event_sound)
+
+                       if(autocvar_cl_spawn_event_sound && (particlesAndOrSound & BIT(1)))
                        {
                                sound(this, CH_TRIGGER, SND_SPAWN, VOL_BASE, ATTEN_NORM);
                        }
index ab0d2bea43f1122610e555bd5eca1d8136eb2e57..0a4ee0c2b46e840865b01f68c6899dd9b5e658ff 100644 (file)
@@ -39,6 +39,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf)
        {
                WriteByte(MSG_ENTITY, etof(this.owner));
                WriteVector(MSG_ENTITY, this.owner.origin);
+               WriteByte(MSG_ENTITY, autocvar_g_spawn_alloweffects);
                send = true;
        }
        else if((to == this.owner) || (IS_SPEC(to) && (to.enemy == this.owner)) )
index d9707a1676677d788c6d18013abb947bcb370dfd..09cf511d5a90302bd29d6fc0f4d5fb97755b818c 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-bool autocvar_g_spawn_alloweffects;
+int autocvar_g_spawn_alloweffects;
 float autocvar_g_spawn_furthest;
 bool autocvar_g_spawn_useallspawns;
 bool autocvar_g_spawnpoints_auto_move_out_of_solid;
index 9dee8744cf08c855a31707978673b92abd410e0c..60cc2fe2f16c27f905cbe1a5d059797475a24e36 100644 (file)
@@ -69,8 +69,8 @@ seta cl_unpress_attack_on_weapon_switch 0 "automatically unpress fire and fire1
 seta cl_weapon_switch_reload 1 "When trying to switch to the currently held weapon, reload it"
 seta cl_weapon_switch_fallback_to_impulse 1 "When trying to switch to a weapon that is not available, switch to an alternative from the same impulse"
 
-seta cl_spawn_event_particles 1 "pointparticles effect whenever a player spawns"
-seta cl_spawn_event_sound 1 "sound effect whenever a player spawns"
+seta cl_spawn_event_particles 1 "pointparticles effect whenever a player spawns (if allowed by the server)"
+seta cl_spawn_event_sound 1 "sound effect whenever a player spawns (if allowed by the server)"
 //seta cl_spawn_point_model 0 "place a model at all spawn points" // still needs a model
 seta cl_spawn_point_particles 1 "pointparticles effect at all spawn points" // managed by effects-.cfg files
 seta cl_spawn_point_dist_max 1200 "maximum distance from which spawnpoint particles will be visible"
index 063425b2615ccb2e2484a722fc1a749bd9b00bee..f4644e0481d0a31713cec010092266207c718737 100644 (file)
@@ -249,7 +249,8 @@ set g_player_damageplayercenter 1 "0: always calculate knockback force direction
 set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps"
 set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps"
 
-set g_spawn_alloweffects 1 "allow clients to enable spawn point and event effects such as particles and sounds, see cl_spawn_ cvars for more info"
+set g_spawn_alloweffects 3 "allow clients to enable spawn point and event effects such as particles and sounds (1 for particles only, 2 for sound only, 3 for both), see cl_spawn_ cvars for more info"
+
 set g_spawn_furthest 0.5 "this amount of the spawns shall be far away from any players"
 set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
 // respawn delay