From a19454f7aefd7f81eeaa97c53790ea1e56d549c3 Mon Sep 17 00:00:00 2001 From: CodeAX2 Date: Tue, 4 Jan 2022 11:11:23 -0700 Subject: [PATCH] Change destroyable component validator to properly check friends --- dGame/dComponents/DestroyableComponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dGame/dComponents/DestroyableComponent.cpp b/dGame/dComponents/DestroyableComponent.cpp index e6f5ba02..aca6c32a 100644 --- a/dGame/dComponents/DestroyableComponent.cpp +++ b/dGame/dComponents/DestroyableComponent.cpp @@ -532,12 +532,12 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor return true; } - // Get if the target entity is an enemy + // Get if the target entity is an enemy and friend bool isEnemy = IsEnemy(targetEntity); + bool isFriend = IsFriend(targetEntity); // Return true if the target type matches what we are targeting - // Friends are entities who are not enemies - return (isEnemy && targetEnemy) || (!isEnemy && targetFriend); + return (isEnemy && targetEnemy) || (isFriend && targetFriend); }