From: drjaska Date: Sun, 30 Jan 2022 00:33:22 +0000 (+0200) Subject: fix regeneration also enabling rotting, now seperately available X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=432fecfe15f03c2fbd3856da05faeb849e026cec;p=xonotic%2Fxonotic-data.pk3dir.git fix regeneration also enabling rotting, now seperately available --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 9d0dde818..a9b0b9744 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -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" diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc index 035718794..8a3ba5349 100644 --- a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc @@ -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) diff --git a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc index 22914adc1..397c76c55 100644 --- a/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc +++ b/qcsrc/common/gamemodes/gamemode/tmayhem/sv_tmayhem.qc @@ -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)