Fix broken menus

This commit is contained in:
Such Meme, Many Skill
2020-05-04 20:48:23 +02:00
parent a9ea9725d4
commit 74ba5bb776
4 changed files with 5 additions and 8 deletions

View File

@@ -20,17 +20,14 @@ void mu_createObjects(int size, menu_entry **menu){
(*menu)[size].name = NULL;
}
int mu_countObjects(menu_entry *entries, u8 propertyMask){
int mu_countObjects(menu_entry *entries, u32 count, u8 propertyMask){
int amount = 0;
for (u32 i = 0; entries[i].name != NULL; i++){
for (u32 i = 0; (count) ? i < count : entries[i].name != NULL; i++){
if (!(entries[i].property & propertyMask))
amount++;
}
while (entries[amount].name != NULL)
amount++;
return amount;
}