From 2122448284a1b8f55c582a3814903fb61860a4f1 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Sun, 17 Apr 2022 21:30:25 -0500 Subject: [PATCH] cleaning up some stuff --- dScripts/WhFans.cpp | 6 +----- dScripts/WhFans.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dScripts/WhFans.cpp b/dScripts/WhFans.cpp index 0139eb1..f2000d6 100644 --- a/dScripts/WhFans.cpp +++ b/dScripts/WhFans.cpp @@ -17,13 +17,9 @@ void WhFans::ToggleFX(Entity* self, bool hit) { fanGroup = ""; } - Game::logger->Log("WhFans", "Toggling FX for Fan Group(%s)\n", fanGroup.c_str()); std::vector fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup); - auto renderComponent = self->GetComponent(); - if (renderComponent == nullptr) { - return; - } + auto* renderComponent = static_cast(self->GetComponent(COMPONENT_TYPE_RENDER)); if (fanVolumes.size() == 0 || !self->GetVar(u"alive")) return; diff --git a/dScripts/WhFans.h b/dScripts/WhFans.h index 9b87430..cac7236 100644 --- a/dScripts/WhFans.h +++ b/dScripts/WhFans.h @@ -9,8 +9,14 @@ class WhFans : public CppScripts::Script public: void OnStartup(Entity* self); void OnDie(Entity* self, Entity* killer); - void OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2, - int32_t param3); + void OnFireEventServerSide( + Entity *self, + Entity *sender, + std::string args, + int32_t param1, + int32_t param2, + int32_t param3 + ); private: void ToggleFX(Entity* self, bool hit); };