]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix regeneration also enabling rotting, now seperately available
authordrjaska <drjaska83@gmail.com>
Sun, 30 Jan 2022 00:33:22 +0000 (02:33 +0200)
committerdrjaska <drjaska83@gmail.com>
Sun, 30 Jan 2022 00:33:22 +0000 (02:33 +0200)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc
qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc

index 9d0dde818b78e9bb908c188b436be3c7c1fb4b79..a9b0b974409633160324714b2c93bee82dd20733 100644 (file)
@@ -615,8 +615,10 @@ set g_tmayhem_pickup_items_remove_weapons_and_ammo 1 "when pickup items are enab
 set g_mayhem_selfdamage 0 "0 = disable selfdamage in mayhem, 1 = enable selfdamage in mayhem"
 set g_tmayhem_selfdamage 0 "0 = disable selfdamage in tmayhem, 1 = enable selfdamage in tmayhem"
 
-set g_mayhem_regenerate 0 "allow players to regenerate hp. rates controlled by hp regeneration and rotting cvars"
-set g_tmayhem_regenerate 0 "allow players to regenerate hp. rates controlled by hp regeneration and rotting cvars"
+set g_mayhem_regenerate 0 "health and/or armor regeneration, according to g_balance_health_regen and g_balance_armor_regen"
+set g_tmayhem_regenerate 0 "health and/or armor regeneration, according to g_balance_health_regen and g_balance_armor_regen"
+set g_mayhem_rot 0 "health and/or armor rotting, according to g_balance_health_rot and g_balance_armor_rot"
+set g_tmayhem_rot 0 "health and/or armor rotting, according to g_balance_health_rot and g_balance_armor_rot"
 
 set g_tmayhem_teams 2 "how many teams are in team mayhem (set by mapinfo)"
 set g_tmayhem_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
index 035718794e9ceb806615b7399c73dc7948ec55a9..8a3ba5349454c6f4bb0fcf89b6b2d12d0824281c 100644 (file)
@@ -5,6 +5,7 @@ float autocvar_g_mayhem_fraglimit;
 float autocvar_g_mayhem_visual_score_limit;
 
 bool autocvar_g_mayhem_regenerate;
+bool autocvar_g_mayhem_rot;
 string autocvar_g_mayhem_weaponarena;
 bool autocvar_g_mayhem_powerups;
 bool autocvar_g_mayhem_selfdamage;
@@ -64,12 +65,13 @@ MUTATOR_HOOKFUNCTION(mayhem, SetStartItems)
        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
 MUTATOR_HOOKFUNCTION(mayhem, PlayerRegen)
 {
-       if (autocvar_g_mayhem_regenerate)
-               return false;
-       return true;
+       if(!autocvar_g_mayhem_regenerate)
+               M_ARGV(2, float) = 0;
+       if(!autocvar_g_mayhem_rot)
+               M_ARGV(3, float) = 0;
+       return (!autocvar_g_mayhem_regenerate && !autocvar_g_mayhem_rot);
 }
 
 MUTATOR_HOOKFUNCTION(mayhem, ForbidThrowCurrentWeapon)
index 22914adc1e2d3992f800d7faa69a03ef8c14a42d..397c76c555ec3931731975f302b276a9c5c7873d 100644 (file)
@@ -10,6 +10,7 @@ int autocvar_g_tmayhem_teams;
 int autocvar_g_tmayhem_teams_override;
 
 bool autocvar_g_tmayhem_regenerate;
+bool autocvar_g_tmayhem_rot;
 string autocvar_g_tmayhem_weaponarena;
 bool autocvar_g_tmayhem_powerups;
 bool autocvar_g_tmayhem_selfdamage;
@@ -107,12 +108,13 @@ MUTATOR_HOOKFUNCTION(tmayhem, SetStartItems)
        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 until PlayerRegen is changed
 MUTATOR_HOOKFUNCTION(tmayhem, PlayerRegen)
 {
-       if (autocvar_g_tmayhem_regenerate)
-               return false;
-       return true;
+       if(!autocvar_g_tmayhem_regenerate)
+               M_ARGV(2, float) = 0;
+       if(!autocvar_g_tmayhem_rot)
+               M_ARGV(3, float) = 0;
+       return (!autocvar_g_tmayhem_regenerate && !autocvar_g_tmayhem_rot);
 }
 
 MUTATOR_HOOKFUNCTION(tmayhem, ForbidThrowCurrentWeapon)