refactor: remove calls to Vec3::newTemp and Vec3::newPermanent

This commit is contained in:
orng
2026-03-26 13:29:05 -05:00
parent bee10e55a8
commit e887c8cf45
63 changed files with 407 additions and 374 deletions

View File

@@ -1112,13 +1112,13 @@ std::shared_ptr<Explosion> ServerLevel::explode(std::shared_ptr<Entity> source,
}
if (player->distanceToSqr(x, y, z) < 64 * 64) {
Vec3* knockbackVec = explosion->getHitPlayerKnockback(player);
Vec3 knockbackVec = explosion->getHitPlayerKnockback(player);
// app.DebugPrintf("Sending %s with knockback (%f,%f,%f)\n",
// knockbackOnly?"knockbackOnly":"allExplosion",knockbackVec->x,knockbackVec->y,knockbackVec->z);
// If the player is not the primary on the system, then we only
// want to send info for the knockback
player->connection->send(std::shared_ptr<ExplodePacket>(
new ExplodePacket(x, y, z, r, &explosion->toBlow, knockbackVec,
new ExplodePacket(x, y, z, r, &explosion->toBlow, &knockbackVec,
knockbackOnly)));
sentTo.push_back(player);
}
@@ -1584,4 +1584,4 @@ void ServerLevel::flagEntitiesToBeRemoved(unsigned int* flags,
if (chunkMap) {
chunkMap->flagEntitiesToBeRemoved(flags, removedFound);
}
}
}