mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Fixes
This commit is contained in:
parent
2122448284
commit
d05601ce64
@ -10,16 +10,19 @@ void WhFans::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WhFans::ToggleFX(Entity* self, bool hit) {
|
void WhFans::ToggleFX(Entity* self, bool hit) {
|
||||||
std::string fanGroup = "";
|
std::string fanGroup;
|
||||||
try {
|
const auto& groups = self->GetGroups();
|
||||||
fanGroup = self->GetGroups()[0];
|
if (!groups.empty()) {
|
||||||
} catch(...) {
|
fanGroup = groups[0];
|
||||||
|
} else {
|
||||||
fanGroup = "";
|
fanGroup = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
|
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
|
||||||
|
|
||||||
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
|
auto* renderComponent = self->GetComponent<RenderComponent*>();
|
||||||
|
|
||||||
|
if (renderComponent == nullptr) return;
|
||||||
|
|
||||||
if (fanVolumes.size() == 0 || !self->GetVar<bool>(u"alive")) return;
|
if (fanVolumes.size() == 0 || !self->GetVar<bool>(u"alive")) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user