]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
update cvar to autocvar in SetStartItems hookfunction
authordrjaska <drjaska83@gmail.com>
Sun, 7 Nov 2021 02:14:28 +0000 (04:14 +0200)
committerdrjaska <drjaska83@gmail.com>
Sun, 7 Nov 2021 02:14:28 +0000 (04:14 +0200)
qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc
qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc

index 36f1159fd94a234b9296b077c5ab5a0d9270b94f..2f8f33716ef3d7fd6ca6186207e741826f06ffae 100644 (file)
@@ -6,6 +6,15 @@ bool autocvar_g_mayhem_powerups;
 bool autocvar_g_mayhem_selfdamage;
 int autocvar_g_mayhem_scoringmethod;
 
+float autocvar_g_mayhem_start_health = 200;
+float autocvar_g_mayhem_start_armor = 200;
+float autocvar_g_mayhem_start_ammo_shells = 60;
+float autocvar_g_mayhem_start_ammo_nails = 320;
+float autocvar_g_mayhem_start_ammo_rockets = 180;
+float autocvar_g_mayhem_start_ammo_cells = 180;
+float autocvar_g_mayhem_start_ammo_plasma = 180;
+float autocvar_g_mayhem_start_ammo_fuel = 0;
+
 void mayhem_DelayedInit(entity this)
 {
        return;
@@ -30,14 +39,14 @@ MUTATOR_HOOKFUNCTION(mayhem, Scores_CountFragsRemaining)
 MUTATOR_HOOKFUNCTION(mayhem, SetStartItems)
 {
        start_items       &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
-       start_health       = warmup_start_health       = cvar("g_mayhem_start_health");
-       start_armorvalue   = warmup_start_armorvalue   = cvar("g_mayhem_start_armor");
-       start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_mayhem_start_ammo_shells");
-       start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_mayhem_start_ammo_nails");
-       start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_mayhem_start_ammo_rockets");
-       start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_mayhem_start_ammo_cells");
-       start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_mayhem_start_ammo_plasma");
-       start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_mayhem_start_ammo_fuel");
+       start_health       = warmup_start_health       = autocvar_g_mayhem_start_health;
+       start_armorvalue   = warmup_start_armorvalue   = autocvar_g_mayhem_start_armor;
+       start_ammo_shells  = warmup_start_ammo_shells  = autocvar_g_mayhem_start_ammo_shells;
+       start_ammo_nails   = warmup_start_ammo_nails   = autocvar_g_mayhem_start_ammo_nails;
+       start_ammo_rockets = warmup_start_ammo_rockets = autocvar_g_mayhem_start_ammo_rockets;
+       start_ammo_cells   = warmup_start_ammo_cells   = autocvar_g_mayhem_start_ammo_cells;
+       start_ammo_plasma  = warmup_start_ammo_plasma  = autocvar_g_mayhem_start_ammo_plasma;
+       start_ammo_fuel    = warmup_start_ammo_fuel    = autocvar_g_mayhem_start_ammo_fuel;
 }
 
 //this hook also enables rotting, as players spawn with more hp and armor than what default rot limits are set to this is a bad idea as of now
index 805199d279704ac04002b4666bf93db0f02e6af2..69f2b0b55e184a2bec3f47f1ddfc99dc05b5d06e 100644 (file)
@@ -10,7 +10,14 @@ bool autocvar_g_tmayhem_powerups;
 bool autocvar_g_tmayhem_selfdamage;
 int autocvar_g_tmayhem_scoringmethod;
 
-
+float autocvar_g_tmayhem_start_health = 200;
+float autocvar_g_tmayhem_start_armor = 200;
+float autocvar_g_tmayhem_start_ammo_shells = 60;
+float autocvar_g_tmayhem_start_ammo_nails = 320;
+float autocvar_g_tmayhem_start_ammo_rockets = 180;
+float autocvar_g_tmayhem_start_ammo_cells = 180;
+float autocvar_g_tmayhem_start_ammo_plasma = 180;
+float autocvar_g_tmayhem_start_ammo_fuel = 0;
 
 // code from here on is just to support maps that don't have team entities
 void tmayhem_SpawnTeam (string teamname, int teamcolor)
@@ -72,14 +79,14 @@ MUTATOR_HOOKFUNCTION(tmayhem, Scores_CountFragsRemaining)
 MUTATOR_HOOKFUNCTION(tmayhem, SetStartItems)
 {
        start_items       &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
-       start_health       = warmup_start_health       = cvar("g_tmayhem_start_health");
-       start_armorvalue   = warmup_start_armorvalue   = cvar("g_tmayhem_start_armor");
-       start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_tmayhem_start_ammo_shells");
-       start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_tmayhem_start_ammo_nails");
-       start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_tmayhem_start_ammo_rockets");
-       start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_tmayhem_start_ammo_cells");
-       start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_tmayhem_start_ammo_plasma");
-       start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_tmayhem_start_ammo_fuel");
+       start_health       = warmup_start_health       = autocvar_g_tmayhem_start_health;
+       start_armorvalue   = warmup_start_armorvalue   = autocvar_g_tmayhem_start_armor;
+       start_ammo_shells  = warmup_start_ammo_shells  = autocvar_g_tmayhem_start_ammo_shells;
+       start_ammo_nails   = warmup_start_ammo_nails   = autocvar_g_tmayhem_start_ammo_nails;
+       start_ammo_rockets = warmup_start_ammo_rockets = autocvar_g_tmayhem_start_ammo_rockets;
+       start_ammo_cells   = warmup_start_ammo_cells   = autocvar_g_tmayhem_start_ammo_cells;
+       start_ammo_plasma  = warmup_start_ammo_plasma  = autocvar_g_tmayhem_start_ammo_plasma;
+       start_ammo_fuel    = warmup_start_ammo_fuel    = autocvar_g_tmayhem_start_ammo_fuel;
 }
 
 //this hook also enables rotting, as players spawn with more hp and armor than what default rot limits are set to this is a bad idea as of now