refactor: expand AUTO_VAR macro

This commit is contained in:
Tropical
2026-03-29 23:59:05 -05:00
parent a330ecdcbb
commit e45151ae64
201 changed files with 1051 additions and 1055 deletions

View File

@@ -3,7 +3,7 @@
int WeighedRandom::getTotalWeight(std::vector<WeighedRandomItem*>* items) {
int totalWeight = 0;
for (AUTO_VAR(it, items->begin()); it != items->end(); it++) {
for (auto it = items->begin(); it != items->end(); it++) {
totalWeight += (*it)->randomWeight;
}
return totalWeight;
@@ -17,7 +17,7 @@ WeighedRandomItem* WeighedRandom::getRandomItem(
int selection = random->nextInt(totalWeight);
for (AUTO_VAR(it, items->begin()); it != items->end(); it++) {
for (auto it = items->begin(); it != items->end(); it++) {
selection -= (*it)->randomWeight;
if (selection < 0) {
return *it;