DarkflameServer/dScripts/02_server/Map/AG/AgMonumentLaserServer.cpp
Aaron Kimbrell 9708ea28dc
refactor: removed hardcoded ag laser logic (#1079)
* Removed hardcoded laser logic

* Address feedback
2023-05-13 18:21:17 -05:00

18 lines
546 B
C++

#include "AgMonumentLaserServer.h"
#include "EntityManager.h"
void AgMonumentLaserServer::OnStartup(Entity* self) {
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
for (auto laser : lasers) {
if (laser) laser->SetBoolean(u"active", true);
}
}
void AgMonumentLaserServer::OnDie(Entity* self, Entity* killer) {
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
for (auto laser : lasers) {
if (laser) laser->SetBoolean(u"active", false);
}
}