Fix a few more floats in arrays
authorMario <zacjardine@y7mail.com>
Sat, 25 Apr 2015 04:16:22 +0000 (14:16 +1000)
committerMario <zacjardine@y7mail.com>
Sat, 25 Apr 2015 04:16:22 +0000 (14:16 +1000)
qcsrc/client/hud.qc
qcsrc/common/weapons/weapons.qh

index ef3d918..0da1b69 100644 (file)
@@ -4660,13 +4660,14 @@ void HUD_Main (void)
                for(i = 0; i < HUD_PANEL_NUM; ++i)
                        panel_order[i] = -1;
                string s = "";
-               float p_num, warning = false;
-               float argc = tokenize_console(autocvar__hud_panelorder);
+               int p_num;
+               bool warning = false;
+               int argc = tokenize_console(autocvar__hud_panelorder);
                if (argc > HUD_PANEL_NUM)
                        warning = true;
                //first detect wrong/missing panel numbers
                for(i = 0; i < HUD_PANEL_NUM; ++i) {
-                       p_num = stof(argv(i));
+                       p_num = stoi(argv(i));
                        if (p_num >= 0 && p_num < HUD_PANEL_NUM) { //correct panel number?
                                if (panel_order[p_num] == -1) //found for the first time?
                                        s = strcat(s, ftos(p_num), " ");
index 7ac8a9e..3a0f211 100644 (file)
@@ -67,7 +67,7 @@ WepSet WEPSET_ALL;
 WepSet WEPSET_SUPERWEAPONS;
 
 // functions:
-entity get_weaponinfo(float id);
+entity get_weaponinfo(int id);
 string W_FixWeaponOrder(string order, float complete);
 string W_UndeprecateName(string s);
 string W_NameWeaponOrder(string order);
@@ -77,21 +77,21 @@ string W_FixWeaponOrder_AllowIncomplete(string order);
 string W_FixWeaponOrder_ForceComplete(string order);
 void W_RandomWeapons(entity e, float n);
 
-string GetAmmoPicture(.float ammotype);
+string GetAmmoPicture(.int ammotype);
 
 #ifdef CSQC
-.float GetAmmoFieldFromNum(int i);
-int GetAmmoStat(.float ammotype);
+.int GetAmmoFieldFromNum(int i);
+int GetAmmoStat(.int ammotype);
 #endif
 
 // ammo types
-.float ammo_shells;
-.float ammo_nails;
-.float ammo_rockets;
-.float ammo_cells;
-.float ammo_plasma;
-.float ammo_fuel;
-.float ammo_none;
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+.int ammo_plasma;
+.int ammo_fuel;
+.int ammo_none;
 
 // other useful macros
 #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)