mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-28 20:45:07 +00:00
refactor: remove calls to Vec3::newTemp when not returned
This commit is contained in:
@@ -108,7 +108,7 @@ void Explosion::explode() {
|
||||
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);
|
||||
Vec3 center(x, y, z);
|
||||
|
||||
AUTO_VAR(itEnd, entities.end());
|
||||
for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) {
|
||||
@@ -146,7 +146,7 @@ void Explosion::explode() {
|
||||
za /= da;
|
||||
}
|
||||
|
||||
double sp = level->getSeenPercent(center, e->bb);
|
||||
double sp = level->getSeenPercent(¢er, e->bb);
|
||||
double pow = (1 - dist) * sp;
|
||||
if (canDamage)
|
||||
e->hurt(DamageSource::explosion(this),
|
||||
@@ -298,4 +298,4 @@ std::shared_ptr<LivingEntity> Explosion::getSourceMob() {
|
||||
if (source->instanceof(eTYPE_LIVINGENTITY))
|
||||
return std::dynamic_pointer_cast<LivingEntity>(source);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user