Merge branch 'main' into PetFixes

This commit is contained in:
jadebenn
2024-12-14 17:30:21 -06:00
239 changed files with 124030 additions and 46555 deletions

View File

@@ -227,20 +227,20 @@ void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo dig
Game::entityManager->ConstructEntity(spawnedPet);
}
Entity* PetDigServer::GetClosestTresure(NiPoint3 position) {
Entity* PetDigServer::GetClosestTreasure(NiPoint3 position) {
float closestDistance = 0;
Entity* closest = nullptr;
for (const auto tresureId : treasures) {
auto* tresure = Game::entityManager->GetEntity(tresureId);
for (const auto treasureId : treasures) {
auto* treasure = Game::entityManager->GetEntity(treasureId);
if (tresure == nullptr) continue;
if (treasure == nullptr) continue;
float distance = Vector3::DistanceSquared(tresure->GetPosition(), position);
float distance = Vector3::DistanceSquared(treasure->GetPosition(), position);
if (closest == nullptr || distance < closestDistance) {
closestDistance = distance;
closest = tresure;
closest = treasure;
}
}

View File

@@ -24,7 +24,7 @@ public:
*/
void OnUse(Entity* self, Entity* user) override;
static Entity* GetClosestTresure(NiPoint3 position);
static Entity* GetClosestTreasure(NiPoint3 position);
private:
static void ProgressPetDigMissions(const Entity* owner, const Entity* chest);