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

@@ -29,9 +29,9 @@ Explosion::Explosion(Level *level, shared_ptr<Entity> source, double x, double y
Explosion::~Explosion()
{
delete random;
for(AUTO_VAR(it, hitPlayers.begin()); it != hitPlayers.end(); ++it)
for( auto& it : hitPlayers )
{
delete it->second;
delete it.second;
}
}
@@ -105,17 +105,14 @@ void Explosion::explode()
vector<shared_ptr<Entity> > entities(levelEntities->begin(), levelEntities->end() );
Vec3 *center = Vec3::newTemp(x, y, z);
AUTO_VAR(itEnd, entities.end());
for (AUTO_VAR(it, entities.begin()); it != itEnd; it++)
for ( auto& e : entities )
{
shared_ptr<Entity> e = *it; //entities->at(i);
// 4J Stu - If the entity is not in a block that would be blown up, then they should not be damaged
// Fix for #46606 - TU5: Content: Gameplay: The player can be damaged and killed by explosions behind obsidian walls
bool canDamage = false;
for(AUTO_VAR(it2, toBlow.begin()); it2 != toBlow.end(); ++it2)
for ( auto& it2 : toBlow )
{
if(e->bb->intersects(it2->x,it2->y,it2->z,it2->x + 1,it2->y + 1,it2->z + 1))
if(e->bb->intersects(it2.x,it2.y,it2.z,it2.x + 1,it2.y + 1,it2.z + 1))
{
canDamage = true;
break;
@@ -192,7 +189,7 @@ void Explosion::finalizeExplosion(bool generateParticles, vector<TilePos> *toBlo
if( fraction == 0 ) fraction = 1;
size_t j = toBlowArray->size() - 1;
//for (size_t j = toBlowArray->size() - 1; j >= 0; j--)
for(AUTO_VAR(it,toBlowArray->rbegin()); it != toBlowArray->rend(); ++it)
for (auto it = toBlowArray->rbegin(); it != toBlowArray->rend(); ++it)
{
TilePos *tp = &(*it); //&toBlowArray->at(j);
int xt = tp->x;
@@ -249,8 +246,7 @@ void Explosion::finalizeExplosion(bool generateParticles, vector<TilePos> *toBlo
if (fire)
{
//for (size_t j = toBlowArray->size() - 1; j >= 0; j--)
for(AUTO_VAR(it,toBlowArray->rbegin()); it != toBlowArray->rend(); ++it)
for (auto it = toBlowArray->rbegin(); it != toBlowArray->rend(); ++it)
{
TilePos *tp = &(*it); //&toBlowArray->at(j);
int xt = tp->x;
@@ -276,7 +272,7 @@ Explosion::playerVec3Map *Explosion::getHitPlayers()
Vec3 *Explosion::getHitPlayerKnockback( shared_ptr<Player> player )
{
AUTO_VAR(it, hitPlayers.find(player));
auto it = hitPlayers.find(player);
if(it == hitPlayers.end() ) return Vec3::newTemp(0.0,0.0,0.0);