From 54d8c45b52e1506e21ee8bb2825f66b978cbd239 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 2 Apr 2023 11:54:34 -0700 Subject: [PATCH 1/3] Don't interrupt players --- dGame/dBehaviors/InterruptBehavior.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dGame/dBehaviors/InterruptBehavior.cpp b/dGame/dBehaviors/InterruptBehavior.cpp index 9035c092..96cba1b1 100644 --- a/dGame/dBehaviors/InterruptBehavior.cpp +++ b/dGame/dBehaviors/InterruptBehavior.cpp @@ -46,6 +46,8 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS if (target == nullptr) return; + if (target->GetLOT() == 1) return; + auto* skillComponent = target->GetComponent(); if (skillComponent == nullptr) return; @@ -71,6 +73,8 @@ void InterruptBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* b if (target == nullptr) return; + if (target->GetLOT() == 1) return; + auto* skillComponent = target->GetComponent(); if (skillComponent == nullptr) return; From b8251c06b8dbdbc215b86d64c3ac6a8293fdc86f Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Mon, 3 Apr 2023 04:11:02 -0700 Subject: [PATCH 2/3] Fix incorrect SwitchMultiple handling --- dGame/dBehaviors/SwitchMultipleBehavior.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dGame/dBehaviors/SwitchMultipleBehavior.cpp b/dGame/dBehaviors/SwitchMultipleBehavior.cpp index 078464bb..23411429 100644 --- a/dGame/dBehaviors/SwitchMultipleBehavior.cpp +++ b/dGame/dBehaviors/SwitchMultipleBehavior.cpp @@ -22,13 +22,9 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream* for (unsigned int i = 0; i < this->m_behaviors.size(); i++) { const double data = this->m_behaviors.at(i).first; + trigger = i; - if (value <= data) { - - trigger = i; - - break; - } + if (value <= data) break; } auto* behavior = this->m_behaviors.at(trigger).second; From 426a84daf98e2edf4657b8b9c43536a65ff91795 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Mon, 3 Apr 2023 09:37:29 -0700 Subject: [PATCH 3/3] Update InterruptBehavior.cpp --- dGame/dBehaviors/InterruptBehavior.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dGame/dBehaviors/InterruptBehavior.cpp b/dGame/dBehaviors/InterruptBehavior.cpp index 96cba1b1..9035c092 100644 --- a/dGame/dBehaviors/InterruptBehavior.cpp +++ b/dGame/dBehaviors/InterruptBehavior.cpp @@ -46,8 +46,6 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS if (target == nullptr) return; - if (target->GetLOT() == 1) return; - auto* skillComponent = target->GetComponent(); if (skillComponent == nullptr) return; @@ -73,8 +71,6 @@ void InterruptBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* b if (target == nullptr) return; - if (target->GetLOT() == 1) return; - auto* skillComponent = target->GetComponent(); if (skillComponent == nullptr) return;