refactor: begin unglobbing std::vector

This commit is contained in:
Tropical
2026-03-06 11:58:11 -06:00
committed by JuiceyDev
parent d2e8a0f9f5
commit 5fad08b9fd
286 changed files with 738 additions and 738 deletions

View File

@@ -97,8 +97,8 @@ void Explosion::explode()
// Fix for 360 #123866 - [CRASH] TU13: Code: Compliance: Placing the TNT next to Ender Crystals will crash the title after a certain amount of time.
// If we explode something next to an EnderCrystal then it creates a new explosion that overwrites the shared vector in the level
// So copy it here instead of directly using the shared one
vector<std::shared_ptr<Entity> > *levelEntities = level->getEntities(source, AABB::newTemp(x0, y0, z0, x1, y1, z1));
vector<std::shared_ptr<Entity> > entities(levelEntities->begin(), levelEntities->end() );
std::vector<std::shared_ptr<Entity> > *levelEntities = level->getEntities(source, AABB::newTemp(x0, y0, z0, x1, y1, z1));
std::vector<std::shared_ptr<Entity> > entities(levelEntities->begin(), levelEntities->end() );
Vec3 *center = Vec3::newTemp(x, y, z);
AUTO_VAR(itEnd, entities.end());
@@ -161,13 +161,13 @@ void Explosion::explode()
}
void Explosion::finalizeExplosion(bool generateParticles, vector<TilePos> *toBlowDirect/*=NULL*/) // 4J - added toBlowDirect parameter
void Explosion::finalizeExplosion(bool generateParticles, std::vector<TilePos> *toBlowDirect/*=NULL*/) // 4J - added toBlowDirect parameter
{
level->playSound(x, y, z, eSoundType_RANDOM_EXPLODE, 4, (1 + (level->random->nextFloat() - level->random->nextFloat()) * 0.2f) * 0.7f);
level->addParticle(eParticleType_hugeexplosion, x, y, z, 0, 0, 0);
// 4J - use pointer to vector directly passed in if this is available - used to speed up calling this from an incoming packet
vector<TilePos> *toBlowArray = toBlowDirect ? toBlowDirect : new vector<TilePos>( toBlow.begin(), toBlow.end() );
std::vector<TilePos> *toBlowArray = toBlowDirect ? toBlowDirect : new std::vector<TilePos>( toBlow.begin(), toBlow.end() );
//toBlowArray.addAll(toBlow);
// TODO 4J Stu - Reverse iterator
PIXBeginNamedEvent(0,"Finalizing explosion size %d",toBlow.size());