Remove AUTO_VAR macro and _toString function (#592)

This commit is contained in:
void_17
2026-03-06 02:11:18 +07:00
committed by GitHub
parent 7d6658fe5b
commit 55231bb8d3
294 changed files with 5067 additions and 5773 deletions

View File

@@ -34,15 +34,15 @@ VillageFeature::VillageFeature(unordered_map<wstring, wstring> options, int iXZS
{
_init(iXZSize);
for (AUTO_VAR(it,options.begin()); it != options.end(); ++it)
for (auto& option : options)
{
if (it->first.compare(OPTION_SIZE_MODIFIER) == 0)
if (option.first.compare(OPTION_SIZE_MODIFIER) == 0)
{
villageSizeModifier = Mth::getInt(it->second, villageSizeModifier, 0);
villageSizeModifier = Mth::getInt(option.second, villageSizeModifier, 0);
}
else if (it->first.compare(OPTION_SPACING) == 0)
else if (option.first.compare(OPTION_SPACING) == 0)
{
townSpacing = Mth::getInt(it->second, townSpacing, minTownSeparation + 1);
townSpacing = Mth::getInt(option.second, townSpacing, minTownSeparation + 1);
}
}
}
@@ -60,7 +60,7 @@ bool VillageFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
#ifdef _LARGE_WORLDS
&& level->dimension->getXZSize() < 128
#endif
)
)
{
townSpacing= 16;// 4J change 32;
}
@@ -135,16 +135,16 @@ VillageFeature::VillageStart::VillageStart(Level *level, Random *random, int chu
if (pendingRoads->empty())
{
int pos = random->nextInt((int)pendingHouses->size());
AUTO_VAR(it, pendingHouses->begin() + pos);
StructurePiece *structurePiece = *it;
auto it = pendingHouses->begin() + pos;
StructurePiece *structurePiece = *it;
pendingHouses->erase(it);
structurePiece->addChildren(startRoom, &pieces, random);
}
else
{
int pos = random->nextInt((int)pendingRoads->size());
AUTO_VAR(it, pendingRoads->begin() + pos);
StructurePiece *structurePiece = *it;
auto it = pendingRoads->begin() + pos;
StructurePiece *structurePiece = *it;
pendingRoads->erase(it);
structurePiece->addChildren(startRoom, &pieces, random);
}
@@ -152,13 +152,12 @@ VillageFeature::VillageStart::VillageStart(Level *level, Random *random, int chu
calculateBoundingBox();
int count = 0;
for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ )
size_t count = 0;
for(auto& piece : pieces)
{
StructurePiece *piece = *it;
if (dynamic_cast<VillagePieces::VillageRoadPiece *>(piece) == NULL)
if ( piece && dynamic_cast<VillagePieces::VillageRoadPiece *>(piece) )
{
count++;
++count;
}
}
valid = count > 2;