DarkflameServer/dScripts/ai/AG/AgQbWall.cpp

16 lines
511 B
C++
Raw Permalink Normal View History

#include "AgQbWall.h"
void AgQbWall::OnQuickBuildComplete(Entity* self, Entity* player) {
self->SetVar(u"player", player->GetObjectID());
auto targetWallSpawners = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner"));
if (targetWallSpawners != "") {
auto groupObjs = Game::entityManager->GetEntitiesInGroup(targetWallSpawners);
for (auto* obj : groupObjs) {
if (obj) {
obj->SetVar(u"player", player->GetObjectID());
obj->OnFireEventServerSide(self, "spawnMobs");
}
}
}
}