From: Mario Date: Sat, 25 Apr 2015 04:16:22 +0000 (+1000) Subject: Fix a few more floats in arrays X-Git-Tag: xonotic-v0.8.1~66 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9c2a09fcfb12440cfefc8b747a4ffd9bcba6d095;p=xonotic%2Fxonotic-data.pk3dir.git Fix a few more floats in arrays --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index ef3d91813..0da1b69d2 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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), " "); diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index 7ac8a9e8d..3a0f21170 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -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)