diff --git a/dScripts/WhFans.cpp b/dScripts/WhFans.cpp index 0139eb1d..f2000d69 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 9b87430b..cac7236d 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); };