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

@@ -37,15 +37,15 @@ bool AreaConstraint::canMoveToPosition(double xo, double yo, double zo,
double xt, double yt, double zt) {
if (!m_restrictsMovement) return true;
Vec3* targetPos = Vec3::newTemp(xt, yt, zt);
Vec3 targetPos(xt, yt, zt);
Minecraft* minecraft = Minecraft::GetInstance();
if (movementArea->contains(targetPos) == contains) {
if (movementArea->contains(&targetPos) == contains) {
return true;
}
Vec3* origPos = Vec3::newTemp(xo, yo, zo);
Vec3 origPos(xo, yo, zo);
double currDist = origPos->distanceTo(movementArea);
double targetDist = targetPos->distanceTo(movementArea);
double currDist = origPos.distanceTo(movementArea);
double targetDist = targetPos.distanceTo(movementArea);
return targetDist < currDist;
}