]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 ef3d91813812fbe5c19b5562241f0a66898fae3c..0da1b69d2cb71e59a7a48687176f4e97c80ed7f0 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 7ac8a9e8dfa09ddacc034db56f0debb6a7014c07..3a0f2117076f249a6972065b00a03173472e8c25 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)