From: Lyberta Date: Sat, 25 Mar 2017 09:14:07 +0000 (+0300) Subject: Survival: Defenders no longer drop weapons by default. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e2c792b43ad37d4151bb4ec291b5e250bc9c4de9;p=xonotic%2Fxonotic-data.pk3dir.git Survival: Defenders no longer drop weapons by default. --- diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index 8eeed33af..39a8f4a8d 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -141,6 +141,9 @@ float autocvar_g_surv_cannon_fodder_attack_scale; /// \brief How much cannon fodder gets damaged. Higher values mean less damage. float autocvar_g_surv_cannon_fodder_defense_scale; +/// \brief Whether defenders drop weapons after death. +int autocvar_g_surv_defender_drop_weapons; + /// \brief A stat that is used to track the time left in the round. .float surv_round_time_stat = _STAT(SURV_ROUND_TIME); /// \brief A stat that is used to track defender team. @@ -1934,13 +1937,22 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDamaged) MUTATOR_HOOKFUNCTION(surv, PlayerDies) { //DebugPrintToChatAll("PlayerDies"); - entity frag_target = M_ARGV(2, entity); - if (!Surv_CanPlayerSpawn(frag_target)) + entity victim = M_ARGV(2, entity); + if ((victim.team == surv_defenderteam) && + (autocvar_g_surv_defender_drop_weapons == false)) + { + for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity went = weaponentities[slot]; + victim.(went).m_weapon = WEP_Null; + } + } + if (!Surv_CanPlayerSpawn(victim)) { - frag_target.respawn_flags = RESPAWN_SILENT; - if (IS_BOT_CLIENT(frag_target)) + victim.respawn_flags = RESPAWN_SILENT; + if (IS_BOT_CLIENT(victim)) { - bot_clear(frag_target); + bot_clear(victim); } } return true; diff --git a/survival.cfg b/survival.cfg index f80a5627f..4d3486082 100644 --- a/survival.cfg +++ b/survival.cfg @@ -40,7 +40,6 @@ set g_surv_defender_random_start_weapons "" "Weapons that can be randomly given set g_surv_cannon_fodder_num_random_start_weapons 2 "Number of weapons that can be randomly given to cannon fodder during spawn" set g_surv_cannon_fodder_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator" "Weapons that can be randomly given to cannon fodder during spawn" - set g_surv_defender_pickup_shells_small 2 "How many shells do defenders get when they pickup small health/armor" set g_surv_defender_pickup_shells_medium 5 "How many shells do defenders get when they pickup medium health/armor" set g_surv_defender_pickup_shells_big 10 "How many shells do defenders get when they pickup big health/armor" @@ -62,3 +61,5 @@ set g_surv_defender_attack_scale 1 "How much defenders damage others. Higher val set g_surv_defender_defense_scale 3 "How much defenders get damaged. Higher values mean less damage" set g_surv_cannon_fodder_attack_scale 1 "How much cannon fodder damages others. Higher values mean more damage" set g_surv_cannon_fodder_defense_scale 1 "How much cannon fodder gets damaged. Higher values mean less damage" + +set g_surv_defender_drop_weapons 0 "Whether defenders drop weapons after death"