]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a cap to it, so your respawntime can never go below 20% default, and never above...
authorRudolf Polzer <divVerent@gmail.com>
Tue, 13 Jun 2023 13:25:21 +0000 (09:25 -0400)
committerRudolf Polzer <divVerent@gmail.com>
Tue, 13 Jun 2023 13:25:21 +0000 (09:25 -0400)
Should make the game bearable for everyone.

qcsrc/common/mutators/mutator/killers_spawn_faster/sv_respawntime.qc

index 0e158d2502e56bea38f41dc0c92104a87d4ab9e0..10ec7e428f62d76529399919fa664a189e934493 100644 (file)
@@ -3,13 +3,15 @@
 AUTOCVAR(g_killers_spawn_faster, bool, false, "Killers spawn faster: a mutator that penalizes dying, and rewards killing, by adjusting time to respawn");
 AUTOCVAR(g_killers_spawn_faster_frag_modifier, float, -0.25, "Killers spawn faster: respawntime factor change when fragging someone");
 AUTOCVAR(g_killers_spawn_faster_death_modifier, float, 0.5, "Killers spawn faster: respawntime factor change when dying");
+AUTOCVAR(g_killers_spawn_faster_min, float, 0.2, "Minimum factor the respawn time can be multiplied with");
+AUTOCVAR(g_killers_spawn_faster_max, float, 5.0, "Maximum factor the respawn time can be multiplied with");
 REGISTER_MUTATOR(mutator_killers_spawn_faster, autocvar_g_killers_spawn_faster);
 
 float killers_spawn_faster_adjust(float base, float adj) {
        if (adj < 0) {
                adj *= base;
        }
-       return base + adj;
+       return bound(autocvar_g_killers_spawn_faster_min, base + adj, autocvar_g_killers_spawn_faster_max);
 }
 
 MUTATOR_HOOKFUNCTION(mutator_killers_spawn_faster, BuildMutatorsString) {