From 34b5f0f9d646623f6cd8ee4f3183eef865629425 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sat, 31 Dec 2022 02:46:25 -0600 Subject: [PATCH] add uncast to speed behavior (#932) --- dGame/dBehaviors/SpeedBehavior.cpp | 12 ++++++++---- dGame/dBehaviors/SpeedBehavior.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dGame/dBehaviors/SpeedBehavior.cpp b/dGame/dBehaviors/SpeedBehavior.cpp index bec2b1cb..d326aa45 100644 --- a/dGame/dBehaviors/SpeedBehavior.cpp +++ b/dGame/dBehaviors/SpeedBehavior.cpp @@ -29,6 +29,14 @@ void SpeedBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitSt Handle(context, bitStream, branch); } +void SpeedBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch) { + End(context, branch, LWOOBJID_EMPTY); +} + +void SpeedBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) { + End(context, branch, second); +} + void SpeedBehavior::End(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) { auto* target = EntityManager::Instance()->GetEntity(branch.target); if (!target) return; @@ -40,10 +48,6 @@ void SpeedBehavior::End(BehaviorContext* context, BehaviorBranchContext branch, EntityManager::Instance()->SerializeEntity(target); } -void SpeedBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) { - End(context, branch, second); -} - void SpeedBehavior::Load() { m_RunSpeed = GetFloat("run_speed"); m_AffectsCaster = GetBoolean("affects_caster"); diff --git a/dGame/dBehaviors/SpeedBehavior.h b/dGame/dBehaviors/SpeedBehavior.h index 57c46842..88b85820 100644 --- a/dGame/dBehaviors/SpeedBehavior.h +++ b/dGame/dBehaviors/SpeedBehavior.h @@ -15,6 +15,8 @@ public: void Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) override; + void UnCast(BehaviorContext* context, BehaviorBranchContext branch) override; + void Timer(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) override; void End(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) override;