From 5ff121612e096d81aaf493cd0c747449f5f80a61 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sat, 14 Dec 2024 17:35:56 -0800 Subject: [PATCH 1/2] use a cast fix warning remove pragma we dont need this tbh --- .../ControlBehaviorMessages/MoveToInventoryMessage.h | 1 - dGame/dUtilities/Preconditions.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dGame/dPropertyBehaviors/ControlBehaviorMessages/MoveToInventoryMessage.h b/dGame/dPropertyBehaviors/ControlBehaviorMessages/MoveToInventoryMessage.h index e1f88713d..afd7a14c6 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviorMessages/MoveToInventoryMessage.h +++ b/dGame/dPropertyBehaviors/ControlBehaviorMessages/MoveToInventoryMessage.h @@ -8,7 +8,6 @@ class AMFArrayValue; /** * @brief Sent when a player moves a Behavior A at position B to their inventory. */ -#pragma warning("This Control Behavior Message does not have a test yet. Non-developers can ignore this warning.") class MoveToInventoryMessage : public BehaviorMessageBase { public: MoveToInventoryMessage(const AMFArrayValue& arguments); diff --git a/dGame/dUtilities/Preconditions.cpp b/dGame/dUtilities/Preconditions.cpp index a0aac27e7..4de8ca335 100644 --- a/dGame/dUtilities/Preconditions.cpp +++ b/dGame/dUtilities/Preconditions.cpp @@ -137,7 +137,7 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat return inventoryComponent->GetLotCount(value) >= count; case PreconditionType::DoesNotHaveItem: - return inventoryComponent->IsEquipped(value) < count; + return inventoryComponent->IsEquipped(value) < static_cast(count); case PreconditionType::HasAchievement: if (missionComponent == nullptr) return false; return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE; From a8919c8c1411876311db579703601873d7854b04 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:14:07 -0800 Subject: [PATCH 2/2] Update dGame/dUtilities/Preconditions.cpp Co-authored-by: jadebenn --- dGame/dUtilities/Preconditions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dGame/dUtilities/Preconditions.cpp b/dGame/dUtilities/Preconditions.cpp index 4de8ca335..118d9037a 100644 --- a/dGame/dUtilities/Preconditions.cpp +++ b/dGame/dUtilities/Preconditions.cpp @@ -137,7 +137,7 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat return inventoryComponent->GetLotCount(value) >= count; case PreconditionType::DoesNotHaveItem: - return inventoryComponent->IsEquipped(value) < static_cast(count); + return inventoryComponent->IsEquipped(value) && count > 0; case PreconditionType::HasAchievement: if (missionComponent == nullptr) return false; return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;