]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Renamed ITEM_COUNT_HARD_LIMIT to RESOURCE_AMOUNT_HARD_LIMIT.
authorLyberta <lyberta@lyberta.net>
Sun, 27 Aug 2017 06:33:25 +0000 (09:33 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 27 Aug 2017 06:33:25 +0000 (09:33 +0300)
qcsrc/common/t_items.qc
qcsrc/common/t_items.qh
qcsrc/server/client.qc

index 6ee7c1d8b656d436674a31bc1529139d34d9ae96..e47b98a663c7b498db2baa37c5bdae224daafcf2 100644 (file)
@@ -665,7 +665,8 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                                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;
@@ -680,7 +681,7 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                        // 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;
@@ -697,7 +698,7 @@ void GivePlayerResource(entity player, .float resource_type, float amount)
                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;
@@ -721,7 +722,7 @@ void GivePlayerAmmo(entity player, .float ammotype, float amount)
        {
                return;
        }
-       float maxvalue = ITEM_COUNT_HARD_LIMIT;
+       float maxvalue = RESOURCE_AMOUNT_HARD_LIMIT;
        switch (ammotype)
        {
                case ammo_shells:
@@ -751,7 +752,7 @@ void GivePlayerAmmo(entity player, .float ammotype, float amount)
                }
        }
        player.(ammotype) = min(player.(ammotype) + amount,
-               min(maxvalue, ITEM_COUNT_HARD_LIMIT));
+               min(maxvalue, RESOURCE_AMOUNT_HARD_LIMIT));
 }
 
 void GivePlayerFuel(entity player, float amount)
index 14cbd8e3f4816fda3a608f921f07fdd2d9d3c9e1..c7287b67a67b3a1ebc285ad1119f868965e4988f 100644 (file)
@@ -4,8 +4,8 @@
 #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
 
index 0c12e40f0198b0d8063198acdaf30243e0984c2a..4417515cf4e27e0132380ca8a571a39e98cc3566 100644 (file)
@@ -1661,13 +1661,13 @@ void player_regen(entity this)
        // 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.
 }