Change destroyable component validator to properly check friends

This commit is contained in:
CodeAX2 2022-01-04 11:11:23 -07:00
parent d78b2404e2
commit a19454f7ae

View File

@ -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);
}