From 9de84dace31619f14dd1f03a3d6b253bd86e2c7e Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 14 Aug 2020 00:41:37 -0400 Subject: [PATCH] CFlaahgraPlants: Set xf4_damageInfo in constructor --- Runtime/MP1/World/CFlaahgra.cpp | 11 ++++++++++- Runtime/MP1/World/CFlaahgra.hpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Runtime/MP1/World/CFlaahgra.cpp b/Runtime/MP1/World/CFlaahgra.cpp index cd99428d0..5da2f8c51 100644 --- a/Runtime/MP1/World/CFlaahgra.cpp +++ b/Runtime/MP1/World/CFlaahgra.cpp @@ -1284,6 +1284,7 @@ CFlaahgraPlants::CFlaahgraPlants(const TToken& genDesc, const C CMaterialList(EMaterialTypes::Projectile), actParms, kInvalidUniqueId) , xe8_elementGen(std::make_unique(genDesc)) , xf0_ownerId(owner) +, xf4_damageInfo(dInfo) , x130_obbox(xf, extents) { xe8_elementGen->SetOrientation(xf.getRotation()); xe8_elementGen->SetTranslation(xf.origin); @@ -1320,6 +1321,7 @@ void CFlaahgraPlants::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, C mgr.FreeScriptObject(x16c_colAct); } } + void CFlaahgraPlants::Think(float dt, CStateManager& mgr) { if (GetActive()) { xe8_elementGen->Update(dt); @@ -1331,7 +1333,7 @@ void CFlaahgraPlants::Think(float dt, CStateManager& mgr) { } void CFlaahgraPlants::AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) { - g_Renderer->AddParticleGen(*xe8_elementGen.get()); + g_Renderer->AddParticleGen(*xe8_elementGen); CActor::AddToRenderer(frustum, mgr); } @@ -1355,4 +1357,11 @@ void CFlaahgraPlants::Touch(CActor& act, CStateManager& mgr) { CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), diffVec.dot(GetTransform().basis[0]) > 0.f ? GetTransform().basis[0] : -GetTransform().basis[0]); } + +std::optional CFlaahgraPlants::GetTouchBounds() const { + if (!GetActive()) { + return {}; + } + return x110_aabox; +} } // namespace urde::MP1 diff --git a/Runtime/MP1/World/CFlaahgra.hpp b/Runtime/MP1/World/CFlaahgra.hpp index 9fd2c7eac..4ef35e32f 100644 --- a/Runtime/MP1/World/CFlaahgra.hpp +++ b/Runtime/MP1/World/CFlaahgra.hpp @@ -82,7 +82,7 @@ public: void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; void Think(float, CStateManager&) override; void AddToRenderer(const zeus::CFrustum&, CStateManager&) override; - std::optional GetTouchBounds() const override { return x110_aabox; } + std::optional GetTouchBounds() const override; void Touch(CActor&, CStateManager&) override; };