Use structured bindings for map k,v pairs. Place counters for for range iterator loops locally inside their scopes.

This commit is contained in:
2023-12-05 22:12:43 -06:00
parent 6d4f024d3c
commit 30287c91d2
7 changed files with 93 additions and 98 deletions
+1 -2
View File
@@ -123,8 +123,7 @@ void Menu::InitializeCharacterMenuWindow(){
ScrollableWindowComponent*equipList=Component<ScrollableWindowComponent>(data.component->parentMenu,"Equip List");
equipList->RemoveAllComponents();
int counter=0;
for(Item&it:availableEquipment){
for(int counter=0;Item&it:availableEquipment){
float xOffset=(counter%3)*26;
Item&itemInvRef=Inventory::GetItem(it.Name());
MenuItemItemButton*equip=NEW MenuItemItemButton(CHARACTER_MENU,{{2+xOffset,2},{24,24}},itemInvRef,MenuType::ENUM_END,[](MenuFuncData data){