MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace)
{
- if (autocvar_g_random_items)
+ if (MUTATOR_IS_ENABLED(random_items))
{
// Do not replace weapons when random items are enabled.
return;
// Loot
-bool autocvar_g_random_loot; ///< Whether to enable random loot.
-
float autocvar_g_random_loot_min; ///< Minimum amount of loot items.
float autocvar_g_random_loot_max; ///< Maximum amount of loot items.
float autocvar_g_random_loot_time; ///< Amount of time the loot will stay.
//============================= Hooks ========================================
-REGISTER_MUTATOR(random_items, (autocvar_g_random_items ||
- autocvar_g_random_loot));
-
MUTATOR_HOOKFUNCTION(random_items, BuildMutatorsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":random_items");
/// \copyright GNU GPLv2 or any later version.
bool autocvar_g_random_items; ///< Whether to enable random items.
+bool autocvar_g_random_loot; ///< Whether to enable random loot.
enum
{
/// \param[in] prefix Prefix of the cvars that hold probabilities.
/// \return Random classname of the overkill item.
string RandomItems_GetRandomOverkillItemClassName(string prefix);
+
+REGISTER_MUTATOR(random_items, (autocvar_g_random_items ||
+ autocvar_g_random_loot));