refactor: remove calls to Vec3::newTemp when not returned

This commit is contained in:
orng
2026-03-26 04:19:04 -05:00
parent 9405f38f80
commit bee10e55a8
37 changed files with 6791 additions and 6831 deletions

View File

@@ -527,20 +527,20 @@ void Player::spawnEatParticles(std::shared_ptr<ItemInstance> useItem,
}
if (useItem->getUseAnimation() == UseAnim_eat) {
for (int i = 0; i < count; i++) {
Vec3* d = Vec3::newTemp((random->nextFloat() - 0.5) * 0.1,
Math::random() * 0.1 + 0.1, 0);
Vec3 d{(random->nextFloat() - 0.5) * 0.1,
Math::random() * 0.1 + 0.1, 0};
d->xRot(-xRot * PI / 180);
d->yRot(-yRot * PI / 180);
d.xRot(-xRot * PI / 180);
d.yRot(-yRot * PI / 180);
Vec3* p = Vec3::newTemp((random->nextFloat() - 0.5) * 0.3,
-random->nextFloat() * 0.6 - 0.3, 0.6);
p->xRot(-xRot * PI / 180);
p->yRot(-yRot * PI / 180);
*p = p->add(x, y + getHeadHeight(), z);
Vec3 p{(random->nextFloat() - 0.5) * 0.3,
-random->nextFloat() * 0.6 - 0.3, 0.6};
p.xRot(-xRot * PI / 180);
p.yRot(-yRot * PI / 180);
p = p.add(x, y + getHeadHeight(), z);
level->addParticle(PARTICLE_ICONCRACK(useItem->getItem()->id, 0),
p->x, p->y, p->z, d->x, d->y + 0.05, d->z);
p.x, p.y, p.z, d.x, d.y + 0.05, d.z);
}
// 4J Stu - Was L"mob.eat" which doesnt exist