From: Mario Date: Sat, 25 Apr 2015 02:52:46 +0000 (+1000) Subject: Fix some more floats in arrays X-Git-Tag: xonotic-v0.8.1~68 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af7bc3fcee25a3b4988bfa7f59a8a52c85c4f13d;p=xonotic%2Fxonotic-data.pk3dir.git Fix some more floats in arrays --- diff --git a/qcsrc/menu/item/listbox.qc b/qcsrc/menu/item/listbox.qc index 178b12b9a..478a2063f 100644 --- a/qcsrc/menu/item/listbox.qc +++ b/qcsrc/menu/item/listbox.qc @@ -10,7 +10,7 @@ CLASS(ListBox) EXTENDS(Item) METHOD(ListBox, focusLeave, void(entity)) ATTRIB(ListBox, focusable, float, 1) ATTRIB(ListBox, allowFocusSound, float, 1) - ATTRIB(ListBox, selectedItem, float, 0) + ATTRIB(ListBox, selectedItem, int, 0) ATTRIB(ListBox, size, vector, '0 0 0') ATTRIB(ListBox, origin, vector, '0 0 0') ATTRIB(ListBox, scrollPos, float, 0) // measured in window heights, fixed when needed diff --git a/qcsrc/menu/item/textslider.qc b/qcsrc/menu/item/textslider.qc index 6e9d65efa..93d4090e0 100644 --- a/qcsrc/menu/item/textslider.qc +++ b/qcsrc/menu/item/textslider.qc @@ -12,7 +12,7 @@ CLASS(TextSlider) EXTENDS(Slider) METHOD(TextSlider, configureTextSliderValues, void(entity, string)) ATTRIBARRAY(TextSlider, valueStrings, string, 256) ATTRIBARRAY(TextSlider, valueIdentifiers, string, 256) - ATTRIB(TextSlider, nValues, float, 0) + ATTRIB(TextSlider, nValues, int, 0) ENDCLASS(TextSlider) #endif diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index eb1afc0a5..5c2b898f2 100644 --- a/qcsrc/menu/xonotic/keybinder.qc +++ b/qcsrc/menu/xonotic/keybinder.qc @@ -251,7 +251,7 @@ void XonoticKeyBinder_doubleClickListBoxItem(entity me, float i, vector where) { KeyBinder_Bind_Change(NULL, me); } -void XonoticKeyBinder_setSelected(entity me, float i) +void XonoticKeyBinder_setSelected(entity me, int i) { // handling of "unselectable" items i = floor(0.5 + bound(0, i, me.nItems - 1)); @@ -280,8 +280,7 @@ void XonoticKeyBinder_setSelected(entity me, float i) } float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift) { - float r; - r = 1; + bool r = true; switch(key) { case K_ENTER: diff --git a/qcsrc/menu/xonotic/serverlist.qc b/qcsrc/menu/xonotic/serverlist.qc index db7ac8481..29877c5d5 100644 --- a/qcsrc/menu/xonotic/serverlist.qc +++ b/qcsrc/menu/xonotic/serverlist.qc @@ -126,10 +126,10 @@ void ServerList_Info_Click(entity btn, entity me); void ServerList_Update_favoriteButton(entity btn, entity me); // fields for category entities -const float MAX_CATEGORIES = 9; -const float CATEGORY_FIRST = 1; +const int MAX_CATEGORIES = 9; +const int CATEGORY_FIRST = 1; entity categories[MAX_CATEGORIES]; -float category_ent_count; +int category_ent_count; .string cat_name; .string cat_string; .string cat_enoverride_string; @@ -138,9 +138,9 @@ float category_ent_count; .float cat_dioverride; // fields for drawing categories -float category_name[MAX_CATEGORIES]; -float category_item[MAX_CATEGORIES]; -float category_draw_count; +int category_name[MAX_CATEGORIES]; +int category_item[MAX_CATEGORIES]; +int category_draw_count; #define SLIST_CATEGORIES \ SLIST_CATEGORY(CAT_FAVORITED, "", "", ZCTX(_("SLCAT^Favorites"))) \ diff --git a/qcsrc/menu/xonotic/weaponslist.qc b/qcsrc/menu/xonotic/weaponslist.qc index 1d3b897fc..46d4e273f 100644 --- a/qcsrc/menu/xonotic/weaponslist.qc +++ b/qcsrc/menu/xonotic/weaponslist.qc @@ -65,9 +65,8 @@ void XonoticWeaponsList_resizeNotify(entity me, vector relOrigin, vector relSize } float XonoticWeaponsList_mouseDrag(entity me, vector pos) { - float f, i; - i = me.selectedItem; - f = SUPER(XonoticWeaponsList).mouseDrag(me, pos); + int i = me.selectedItem; + float f = SUPER(XonoticWeaponsList).mouseDrag(me, pos); if(me.pressed != 1) // don't change priority if the person is just scrolling {