From 32f8bda53866996de7ece9cb591e2b82d1fb7e9c Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Fri, 16 Dec 2022 15:23:38 -0600 Subject: [PATCH] Allow the player to be interrupted (#881) --- dGame/dComponents/SkillComponent.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dGame/dComponents/SkillComponent.cpp b/dGame/dComponents/SkillComponent.cpp index c749dbaf..445a837e 100644 --- a/dGame/dComponents/SkillComponent.cpp +++ b/dGame/dComponents/SkillComponent.cpp @@ -181,17 +181,11 @@ void SkillComponent::Reset() { } void SkillComponent::Interrupt() { - if (m_Parent->IsPlayer()) return; - + // TODO: need to check immunities on the destroyable component, but they aren't implemented auto* combat = m_Parent->GetComponent(); + if (combat != nullptr && combat->GetStunImmune()) return; - if (combat != nullptr && combat->GetStunImmune()) { - return; - } - - for (const auto& behavior : this->m_managedBehaviors) { - behavior.second->Interrupt(); - } + for (const auto& behavior : this->m_managedBehaviors) behavior.second->Interrupt(); } void SkillComponent::RegisterCalculatedProjectile(const LWOOBJID projectileId, BehaviorContext* context, const BehaviorBranchContext& branch, const LOT lot, const float maxTime,