REGISTER_NET_LINKED(ENT_CLIENT_ITEM)
-/// \brief Unconditional maximum amount of items the player can have.
-const int ITEM_COUNT_HARD_LIMIT = 999;
-
#ifdef CSQC
bool autocvar_cl_ghost_items_vehicle = true;
.vector item_glowmod;
{
return;
}
+ // Ugly hack. We do not check if health goes beyond hard limit since
+ // currently it is done in player_regen. We need to bring back this check
+ // when other code is ported to this function.
player.health = bound(player.health, player.health + amount,
- min(autocvar_g_balance_health_limit, ITEM_COUNT_HARD_LIMIT));
+ autocvar_g_balance_health_limit);
+ // Correct code:
+ //player.health = bound(player.health, player.health + amount,
+ // min(autocvar_g_balance_health_limit, ITEM_COUNT_HARD_LIMIT));
player.pauserothealth_finished = max(player.pauserothealth_finished, time +
autocvar_g_balance_pause_health_rot);
}
{
return;
}
+ // Ugly hack. We do not check if armor goes beyond hard limit since
+ // currently it is done in player_regen. We need to bring back this check
+ // when other code is ported to this function.
player.armorvalue = bound(player.armorvalue, player.armorvalue + amount,
- min(autocvar_g_balance_armor_limit, ITEM_COUNT_HARD_LIMIT));
+ autocvar_g_balance_armor_limit);
+ // Correct code:
+ //player.armorvalue = bound(player.armorvalue, player.armorvalue + amount,
+ // min(autocvar_g_balance_armor_limit, ITEM_COUNT_HARD_LIMIT));
player.pauserotarmor_finished = max(player.pauserotarmor_finished, time +
autocvar_g_balance_pause_armor_rot);
}
maxvalue = g_pickup_nails_max;
break;
}
- case ammo_fuel:
- {
- maxvalue = g_pickup_fuel_max;
- break;
- }
}
player.(ammotype) = min(player.(ammotype) + amount,
min(maxvalue, ITEM_COUNT_HARD_LIMIT));
regen_health_stable = M_ARGV(9, float);
regen_health_rotstable = M_ARGV(10, float);
+ // Ugly hack to make sure the haelth and armor don't go beyond hard limit.
+ // TODO: Remove this hack when all code uses GivePlayerHealth and
+ // GivePlayerArmor.
+ this.health = bound(0, this.health, ITEM_COUNT_HARD_LIMIT);
+ this.armorvalue = bound(0, this.armorvalue, ITEM_COUNT_HARD_LIMIT);
+ // End hack.
if(!mutator_returnvalue)
if(!STAT(FROZEN, this))