/// \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.
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;
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"
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"