]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/ammo.qc
Clean up some dangling definitions on the client side
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / ammo.qc
index 7bae78cb6c5ab38385ea6a0b1cbdbc338be2a732..01ce50cdbb6f87e03291c9f57232dc683aff76c9 100644 (file)
@@ -1,6 +1,12 @@
 #include "ammo.qh"
 
+#include <client/autocvars.qh>
+#include <client/defs.qh>
+#include <client/miscfunctions.qh>
+#include <client/view.qh>
 #include <common/t_items.qh>
+#include <common/wepent.qh>
+#include <common/mutators/mutator/nades/nades.qh>
 
 // Ammo (#1)
 
@@ -14,12 +20,10 @@ void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector col
                autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
-void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator
-
-void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
+void DrawAmmoItem(vector myPos, vector mySize, int ammoType, bool isCurrent, bool isInfinite)
 {
     TC(bool, isCurrent); TC(bool, isInfinite);
-       if(ammoType == ammo_none)
+       if(ammoType == RESOURCE_NONE)
                return;
 
        // Initialize variables
@@ -27,7 +31,7 @@ void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bo
        int ammo;
        if(autocvar__hud_configure)
        {
-               isCurrent = (ammoType == ammo_rockets); // Rockets always current
+               isCurrent = (ammoType == RESOURCE_ROCKETS); // Rockets always current
                ammo = 60;
        }
        else
@@ -179,14 +183,14 @@ void HUD_Ammo()
        {
                if(autocvar__hud_configure)
                {
-                       DrawAmmoItem(pos, ammo_size, ammo_rockets, true, false);
+                       DrawAmmoItem(pos, ammo_size, RESOURCE_ROCKETS, true, false);
                }
                else
                {
                        DrawAmmoItem(
                                pos,
                                ammo_size,
-                               wep.ammo_field,
+                               wep.ammo_type,
                                true,
                                infinite_ammo
                        );
@@ -201,16 +205,16 @@ void HUD_Ammo()
        }
        else
        {
-               .int ammotype;
+               int ammotype;
                row = column = 0;
                for(i = 0; i < AMMO_COUNT; ++i)
                {
-                       ammotype = GetAmmoFieldFromNum(i);
+                       ammotype = GetAmmoTypeFromNum(i);
                        DrawAmmoItem(
                                pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)),
                                ammo_size,
                                ammotype,
-                               (wep.ammo_field == ammotype),
+                               (wep.ammo_type == ammotype),
                                infinite_ammo
                        );