# HG changeset patch # User Adam Kaminski # Date 1636310661 18000 # Sun Nov 07 13:44:21 2021 -0500 # Node ID f1fda9e9923da8f648b6916a4a8b6c66b734e0af # Parent 7fbfd2f44c962c6cf84b60818ee6a6a18030052c Added the CVar "sv_respawndelaytime", which allows servers to decide how long players must wait before they can respawn. diff -r 7fbfd2f44c96 -r f1fda9e9923d docs/zandronum-history.txt --- a/docs/zandronum-history.txt Sun Nov 07 11:40:10 2021 -0500 +++ b/docs/zandronum-history.txt Sun Nov 07 13:44:21 2021 -0500 @@ -61,6 +61,7 @@ + - Added DMFlags: "sv_shootthroughallies" and "sv_dontpushallies", so a player's attacks can pass through and not push their allies. [Kaminsky] + - Added packet loss mitigation, which the client can control using the CVar "cl_backupcommands". [Kaminsky] + - Added the server CVAR "sv_country", which allows servers to present their country to launchers. [Sean] ++ - Added the CVar "sv_respawndelaytime", which allows servers to decide how long players must wait before they can respawn. [Kaminsky] - - Fixed: Bots tries to jump to reach item when sv_nojump is true. [sleep] - - Fixed: ACS function SetSkyScrollSpeed didn't work online. [Edward-san] - - Fixed: color codes in callvote reasons weren't terminated properly. [Dusk] diff -r 7fbfd2f44c96 -r f1fda9e9923d src/p_interaction.cpp --- a/src/p_interaction.cpp Sun Nov 07 11:40:10 2021 -0500 +++ b/src/p_interaction.cpp Sun Nov 07 13:44:21 2021 -0500 @@ -747,14 +747,20 @@ // Death script execution, care of Skull Tag FBehavior::StaticStartTypedScripts (SCRIPT_Death, this, true); + + // [EP] Avoid instant body disappearing if the player had no lives left. + bool bNoMoreLivesLeft = ( GAMEMODE_AreLivesLimited() && GAMEMODE_IsGameInProgress() && ( player->ulLivesLeft == 0 )); // [RH] Force a delay between death and respawn if ((( zacompatflags & ZACOMPATF_INSTANTRESPAWN ) == false ) || - ( player->bSpawnTelefragged ) || - // [EP] Avoid instant body disappearing if the player had no lives left. - ( GAMEMODE_AreLivesLimited() && GAMEMODE_IsGameInProgress() && ( player->ulLivesLeft == 0 ))) + ( player->bSpawnTelefragged ) || ( bNoMoreLivesLeft )) { - player->respawn_time = level.time + TICRATE; + // [AK] The respawn delay can be adjusted, but the minimum is one second. This only works if + // the player wasn't spawn telefragged and still has lives left. + if (( sv_respawndelaytime > 1 ) && ( player->bSpawnTelefragged == false ) && ( bNoMoreLivesLeft == false )) + player->respawn_time = level.time + sv_respawndelaytime * TICRATE; + else + player->respawn_time = level.time + TICRATE; // [BC] Don't respawn quite so fast on forced respawn. It sounds weird when your // scream isn't completed. diff -r 7fbfd2f44c96 -r f1fda9e9923d src/sv_main.cpp --- a/src/sv_main.cpp Sun Nov 07 11:40:10 2021 -0500 +++ b/src/sv_main.cpp Sun Nov 07 13:44:21 2021 -0500 @@ -267,6 +267,7 @@ CVAR( Bool, sv_forcepassword, false, CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_SERVERINFO ) CVAR( Bool, sv_forcejoinpassword, false, CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_SERVERINFO ) CVAR( Int, sv_forcerespawntime, 0, CVAR_ARCHIVE|CVAR_SERVERINFO ) // [RK] +CVAR( Int, sv_respawndelaytime, 1, CVAR_ARCHIVE|CVAR_SERVERINFO ) // [AK] CVAR( Bool, sv_showlauncherqueries, false, CVAR_ARCHIVE ) CVAR( Bool, sv_timestamp, false, CVAR_ARCHIVE|CVAR_NOSETBYACS ) CVAR( Int, sv_timestampformat, 0, CVAR_ARCHIVE|CVAR_NOSETBYACS ) diff -r 7fbfd2f44c96 -r f1fda9e9923d src/sv_main.h --- a/src/sv_main.h Sun Nov 07 11:40:10 2021 -0500 +++ b/src/sv_main.h Sun Nov 07 13:44:21 2021 -0500 @@ -683,6 +683,7 @@ EXTERN_CVAR( Bool, sv_forcepassword ); EXTERN_CVAR( Bool, sv_forcejoinpassword ); EXTERN_CVAR( Int, sv_forcerespawntime ); // [RK] Delay used for forced respawn +EXTERN_CVAR( Int, sv_respawndelaytime ); EXTERN_CVAR( Bool, sv_showlauncherqueries ); EXTERN_CVAR( Int, sv_maxclients ); EXTERN_CVAR( Int, sv_maxplayers );