From af7bc3fcee25a3b4988bfa7f59a8a52c85c4f13d Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 25 Apr 2015 12:52:46 +1000 Subject: [PATCH] Fix some more floats in arrays --- qcsrc/menu/item/listbox.qc | 2 +- qcsrc/menu/item/textslider.qc | 2 +- qcsrc/menu/xonotic/keybinder.qc | 5 ++--- qcsrc/menu/xonotic/serverlist.qc | 12 ++++++------ qcsrc/menu/xonotic/weaponslist.qc | 5 ++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/qcsrc/menu/item/listbox.qc b/qcsrc/menu/item/listbox.qc index 178b12b9a0..478a2063ff 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 6e9d65efaf..93d4090e02 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 eb1afc0a59..5c2b898f21 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 db7ac84814..29877c5d5e 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 1d3b897fc0..46d4e273f0 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 { -- 2.39.2