Skip to content

Commit

Permalink
Game Menu: Fixed assertion failures attempting to select list items
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 30, 2011
1 parent 5221174 commit d43b176
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doomsday/plugins/common/src/hu_lib.c
Expand Up @@ -1785,22 +1785,22 @@ int MNList_CommandResponder(mn_object_t* obj, menucommand_e cmd)
int MNList_Selection(mn_object_t* obj)
{
mndata_list_t* list = (mndata_list_t*)obj->_typedata;
assert(obj && obj->_type == MN_LIST);
assert(obj && (obj->_type == MN_LIST || obj->_type == MN_LISTINLINE));
return list->selection;
}

boolean MNList_SelectionIsVisible(mn_object_t* obj)
{
const mndata_list_t* list = (mndata_list_t*)obj->_typedata;
assert(obj && obj->_type == MN_LIST);
assert(obj && (obj->_type == MN_LIST || obj->_type == MN_LISTINLINE));
return (list->selection >= list->first && list->selection < list->first + list->numvis);
}

int MNList_FindItem(const mn_object_t* obj, int dataValue)
{
mndata_list_t* list = (mndata_list_t*)obj->_typedata;
int i;
assert(obj && obj->_type == MN_LIST);
assert(obj && (obj->_type == MN_LIST || obj->_type == MN_LISTINLINE));

for(i = 0; i < list->count; ++i)
{
Expand All @@ -1822,7 +1822,7 @@ boolean MNList_SelectItem(mn_object_t* obj, int flags, int itemIndex)
{
mndata_list_t* list = (mndata_list_t*)obj->_typedata;
int oldSelection = list->selection;
assert(obj && obj->_type == MN_LIST);
assert(obj && (obj->_type == MN_LIST || obj->_type == MN_LISTINLINE));

if(0 > itemIndex || itemIndex >= list->count) return false;

Expand Down

0 comments on commit d43b176

Please sign in to comment.