DarkflameServer/dScripts/ai/GF/GfJailWalls.cpp

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

31 lines
926 B
C++
Raw Permalink Normal View History

#include "GfJailWalls.h"
#include "dZoneManager.h"
#include "GeneralUtils.h"
#include "eQuickBuildState.h"
void GfJailWalls::OnQuickBuildComplete(Entity* self, Entity* target) {
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
spawner->Deactivate();
}
2022-07-28 13:39:57 +00:00
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
spawner->Deactivate();
}
}
void GfJailWalls::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
if (state != eQuickBuildState::RESETTING) return;
2022-07-28 13:39:57 +00:00
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
spawner->Activate();
2022-07-28 13:39:57 +00:00
}
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
spawner->Activate();
}
}