mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-01 06:01:30 +00:00
refactor: remove calls to Vec3::newTemp when not returned
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user