DarkflameServer/dScripts/MonCoreSmashableDoors.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
508 B
C++
Raw Normal View History

#include "MonCoreSmashableDoors.h"
#include "EntityManager.h"
void MonCoreSmashableDoors::OnDie(Entity* self, Entity* killer) {
auto myNum = self->GetVarAsString(u"spawner_name");
myNum = myNum.substr(myNum.length() - 1, 1);
2022-07-28 13:39:57 +00:00
auto triggerGroup = "CoreNookTrig0" + myNum;
// Get the trigger
auto triggers = EntityManager::Instance()->GetEntitiesInGroup(triggerGroup);
if (triggers.empty()) {
return;
}
for (auto trigger : triggers) {
trigger->OnFireEventServerSide(self, "DoorSmashed");
}
}