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));
+ // min(autocvar_g_balance_health_limit,
+ // RESOURCE_AMOUNT_HARD_LIMIT));
player.pauserothealth_finished = max(player.pauserothealth_finished,
time + autocvar_g_balance_pause_health_rot);
return;
// Correct code:
//player.armorvalue = bound(player.armorvalue, player.armorvalue +
// amount, min(autocvar_g_balance_armor_limit,
- // ITEM_COUNT_HARD_LIMIT));
+ // RESOURCE_AMOUNT_HARD_LIMIT));
player.pauserotarmor_finished = max(player.pauserotarmor_finished,
time + autocvar_g_balance_pause_armor_rot);
return;
case ammo_fuel:
{
player.ammo_fuel = bound(player.ammo_fuel, player.ammo_fuel +
- amount, min(g_pickup_fuel_max, ITEM_COUNT_HARD_LIMIT));
+ amount, min(g_pickup_fuel_max, RESOURCE_AMOUNT_HARD_LIMIT));
player.pauserotfuel_finished = max(player.pauserotfuel_finished,
time + autocvar_g_balance_pause_fuel_rot);
return;
{
return;
}
- float maxvalue = ITEM_COUNT_HARD_LIMIT;
+ float maxvalue = RESOURCE_AMOUNT_HARD_LIMIT;
switch (ammotype)
{
case ammo_shells:
}
}
player.(ammotype) = min(player.(ammotype) + amount,
- min(maxvalue, ITEM_COUNT_HARD_LIMIT));
+ min(maxvalue, RESOURCE_AMOUNT_HARD_LIMIT));
}
void GivePlayerFuel(entity player, float amount)
#include <server/defs.qh>
#endif
-/// \brief Unconditional maximum amount of items the player can have.
-const int ITEM_COUNT_HARD_LIMIT = 999;
+/// \brief Unconditional maximum amount of resources the player can have.
+const int RESOURCE_AMOUNT_HARD_LIMIT = 999;
const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// 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.
- if (this.health > ITEM_COUNT_HARD_LIMIT)
+ if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
{
- this.health = ITEM_COUNT_HARD_LIMIT;
+ this.health = RESOURCE_AMOUNT_HARD_LIMIT;
}
- if (this.armorvalue > ITEM_COUNT_HARD_LIMIT)
+ if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
{
- this.armorvalue = ITEM_COUNT_HARD_LIMIT;
+ this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
}
// End hack.
}