]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'drjaska/silent-respawn' into 'master'
authorDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:11 +0000 (23:47 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:11 +0000 (23:47 +0000)
server side option for both (old) or individually silent or particleless (re)spawning

See merge request xonotic/xonotic-data.pk3dir!1218

1  2 
qcsrc/client/main.qc
xonotic-server.cfg

diff --combined qcsrc/client/main.qc
index 5044ef034186a11a0bd5411ae98363f21930f60e,8a8e3f39d3e354cf3cf4cbf76d7401975c020fd5..40cb19f74057e249202a916f3fb156ff245826cf
@@@ -43,7 -43,7 +43,7 @@@
  // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
  // Useful for precaching things
  
 -void CSQC_Init()
 +void CSQC_Init(float apilevel, string enginename, float engineversion)
  {
        prvm_language = strzone(cvar_string("prvm_language"));
  
@@@ -198,8 -198,6 +198,8 @@@ void Shutdown(
  
        localcmd("\n-button12\n");
  
 +      strfree(gametype_custom_name);
 +
        deactivate_minigame();
        HUD_MinigameMenu_Close(NULL, NULL, NULL);
  
@@@ -877,11 -875,13 +877,13 @@@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool 
        {
                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)
                                {
                                        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);
                        }
@@@ -1091,7 -1092,6 +1094,7 @@@ NET_HANDLE(ENT_CLIENT_SCORES_INFO, boo
  {
        make_pure(this);
        gametype = ReadRegistered(Gametypes);
 +      strcpy(gametype_custom_name, ReadString());
        teamplay = _MapInfo_GetTeamPlayBool(gametype);
        HUD_ModIcons_SetFunc();
        FOREACH(Scores, true, {
diff --combined xonotic-server.cfg
index 7980c55fb50c4dfda2d9c1173124ae5a040c1f57,f4644e0481d0a31713cec010092266207c718737..e638577222b1cc279385114895fd6e4e8777e022
@@@ -51,7 -51,7 +51,7 @@@ set sv_timeout_number 2 "how many timeo
  set sv_timeout_leadtime 4 "how long the players will be informed that a timeout was called before it starts, in seconds"
  set sv_timeout_resumetime 3 "how long the remaining timeout-time will be after a player called the timein command"
  
 -set sv_autopause 1 "Single player or listen server: pause while all clients have the menu, console or chat open. Dedicated server: pause after starting a map if the server is empty and unpause when the first player joins the empty server."
 +seta sv_autopause 1 "Single player or listen server: pause while all clients have the menu, console or chat open. Dedicated server: pause after starting a map if the server is empty and unpause when the first player joins the empty server."
  
  set g_telefrags 1 "telefragging, i.e. killing someone who stands in the way of someone who is teleporting"
  set g_telefrags_teamplay 1 "never telefrag team mates"
@@@ -249,7 -249,8 +249,8 @@@ set g_player_damageplayercenter 1 "0: a
  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