Fixed Misspelling of Tresure variable for petcomponent (#1617)

This commit is contained in:
Tiernan
2024-11-17 20:48:48 -06:00
committed by GitHub
parent 112c2367cc
commit d8b86072d4
4 changed files with 27 additions and 27 deletions

View File

@@ -215,20 +215,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

@@ -17,7 +17,7 @@ public:
void OnStartup(Entity* self) override;
void OnDie(Entity* self, Entity* killer) override;
static Entity* GetClosestTresure(NiPoint3 position);
static Entity* GetClosestTreasure(NiPoint3 position);
private:
static void ProgressPetDigMissions(const Entity* owner, const Entity* chest);