DarkflameServer/dScripts/MonCoreSmashableDoors.cpp
EmosewaMC 37de00464e M-Z scripts
Removing extraneous includes from scripts that start with the letter M-Z
2022-06-23 01:26:44 -07:00

25 lines
521 B
C++

#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);
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");
}
}