From aa212ae6d890be30a8aa796abed604ce557ad0e2 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Tue, 3 May 2022 22:38:49 -0500 Subject: [PATCH] Add precondition check --- dGame/dComponents/PetComponent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dGame/dComponents/PetComponent.cpp b/dGame/dComponents/PetComponent.cpp index 97c7e95b..39d7eb60 100644 --- a/dGame/dComponents/PetComponent.cpp +++ b/dGame/dComponents/PetComponent.cpp @@ -75,6 +75,12 @@ PetComponent::PetComponent(Entity* parent, uint32_t componentId) : Component(par m_MovementAI = nullptr; m_TresureTime = 0; m_Preconditions = nullptr; + + std::string checkPreconditions = GeneralUtils::UTF16ToWTF8(parent->GetVar(u"CheckPrecondition")); + + if (!checkPreconditions.empty()) { + SetPreconditions(checkPreconditions); + } } void PetComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags)