]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to override the gamemode specific respawn delays, also add a hook to...
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 10:42:43 +0000 (20:42 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 10:42:43 +0000 (20:42 +1000)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/cl_player.qh
qcsrc/server/command/sv_cmd.qc
qcsrc/server/mutators/events.qh

index c87ffa276d03f1df69323ee13af71c3d0ec8dbd2..6a81e3507cc4558196eb7ec92bfbff97aa6ab438 100644 (file)
@@ -477,6 +477,7 @@ set g_respawn_delay_small_count 0 "Player count per team for g_respawn_delay_sma
 set g_respawn_delay_large 2 "large game number of seconds you have to wait before you can respawn again"
 set g_respawn_delay_large_count 8 "Player count per team for g_respawn_delay_large. <=0 values mean the minimum amount of players to have gameplay (typically 2 in FFA, 1 in teamplay)."
 set g_respawn_delay_max 0 "number of seconds you can wait before you're forced to respawn (only effective with g_forced_respawn 1)"
+set g_respawn_delay_forced 0 "enforce regular respawn delay (prevent gamemode specific respawn delays)"
 set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease overwhelming base attacks"
 
 // overtime
index 45de5e3e88658e35ccc99e6056dd7e48cdc512cc..3f4a11a7cefe2125d5b777e03cf5f3106f2bbecc 100644 (file)
@@ -462,6 +462,7 @@ int autocvar_g_respawn_delay_small_count;
 float autocvar_g_respawn_delay_large;
 int autocvar_g_respawn_delay_large_count;
 float autocvar_g_respawn_delay_max;
+bool autocvar_g_respawn_delay_forced;
 bool autocvar_g_respawn_ghosts;
 float autocvar_g_respawn_ghosts_maxtime;
 float autocvar_g_respawn_ghosts_speed;
index cd1ec2e15be6dc19b9ac2fe52507203c4d85bb49..27d1bd0dda0afc7f395b2c0233821207603d3178 100644 (file)
@@ -26,7 +26,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, int de
 #define GAMETYPE_DEFAULTED_SETTING(str) \
        ((gametype_setting_tmp = cvar(strcat("g_", GetGametype(), "_" #str))), \
         (gametype_setting_tmp < 0) ? 0 : \
-        (gametype_setting_tmp == 0) ? max(0, autocvar_g_##str) : \
+        (gametype_setting_tmp == 0 || autocvar_g_respawn_delay_forced) ? max(0, autocvar_g_##str) : \
         gametype_setting_tmp)
 
 
index de36b375410b9e8426fe0e7eef7fe3319c8a0080..fdf82e368fffaa4826a95a0c772707754a8dbabb 100644 (file)
@@ -1905,6 +1905,10 @@ void GameCommand(string command)
                        return;
                }
        }
+       else if(MUTATOR_CALLHOOK(SV_ParseServerCommand, strtolower(argv(0)), argc, command))
+       {
+               return; // handled by a mutator
+       }
        else if(BanCommand(command))
        {
                return; // handled by server/command/ipban.qc
index 234f56bebd20baed44fefc3c8707a70f690ee904..1dd82a88f27abc2c581a340587954ee40b1be23b 100644 (file)
@@ -399,6 +399,17 @@ int cmd_argc;
 string cmd_string;
 MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand);
 
+/** please read EV_SV_ParseClientCommand description before using */
+#define EV_SV_ParseServerCommand(i, o) \
+    /** command name */ i(string, cmd_name) \
+    /** also, argv() can be used */ i(int, cmd_argc) \
+    /** whole command, use only if you really have to */ i(string, cmd_string) \
+    /**/
+//string cmd_name;
+//int cmd_argc;
+//string cmd_string;
+MUTATOR_HOOKABLE(SV_ParseServerCommand, EV_SV_ParseServerCommand);
+
 /**
  * called when a spawnpoint is being evaluated
  * return 1 to make the spawnpoint unusable