From 53cb9a96efa7d7b3ff5e37cf37d6ede2ca7f22a5 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sun, 12 Nov 2023 22:33:04 -0600 Subject: [PATCH 1/3] Added mission check to pet digs --- dGame/dComponents/PetComponent.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index b82427c1..3e128c76 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -29,6 +29,8 @@ #include "RenderComponent.h" #include "eObjectBits.h" #include "eGameMasterLevel.h" +#include "MissionComponent.h" +#include "eMissionState.h" std::unordered_map PetComponent::buildCache{}; std::unordered_map PetComponent::currentActivities{}; @@ -439,9 +441,17 @@ void PetComponent::Update(float deltaTime) { } } + auto* missionComponent = owner->GetComponent(); + if (missionComponent == nullptr) { + return; + } + + // Determine if "Lost Tags" has been completed and digging has been unlocked + const bool digUnlocked = (missionComponent->GetMissionState(842) == eMissionState::COMPLETE); + Entity* closestTresure = PetDigServer::GetClosestTresure(position); - if (closestTresure != nullptr) { + if (closestTresure != nullptr && digUnlocked) { // Skeleton Dragon Pat special case for bone digging if (closestTresure->GetLOT() == 12192 && m_Parent->GetLOT() != 13067) { goto skipTresure; From 997ea8845380f597ac0c6f1ed4eaac5cc86dafe5 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sun, 12 Nov 2023 23:03:11 -0600 Subject: [PATCH 2/3] Little formatting change --- dGame/dComponents/PetComponent.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index 3e128c76..9623d572 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -442,9 +442,7 @@ void PetComponent::Update(float deltaTime) { } auto* missionComponent = owner->GetComponent(); - if (missionComponent == nullptr) { - return; - } + if (missionComponent == nullptr) return; // Determine if "Lost Tags" has been completed and digging has been unlocked const bool digUnlocked = (missionComponent->GetMissionState(842) == eMissionState::COMPLETE); From c06b5ef4a79a7493759a765e699b410e0aeec8ef Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sun, 12 Nov 2023 23:28:09 -0600 Subject: [PATCH 3/3] More formatting clean-up --- dGame/dComponents/PetComponent.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index 9623d572..df473055 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -29,7 +29,6 @@ #include "RenderComponent.h" #include "eObjectBits.h" #include "eGameMasterLevel.h" -#include "MissionComponent.h" #include "eMissionState.h" std::unordered_map PetComponent::buildCache{}; @@ -442,10 +441,10 @@ void PetComponent::Update(float deltaTime) { } auto* missionComponent = owner->GetComponent(); - if (missionComponent == nullptr) return; + if (!missionComponent) return; - // Determine if "Lost Tags" has been completed and digging has been unlocked - const bool digUnlocked = (missionComponent->GetMissionState(842) == eMissionState::COMPLETE); + // Determine if the "Lost Tags" mission has been completed and digging has been unlocked + const bool digUnlocked = missionComponent->GetMissionState(842) == eMissionState::COMPLETE; Entity* closestTresure = PetDigServer::GetClosestTresure(position);