2021-12-05 17:54:36 +00:00
|
|
|
#include "GfJailWalls.h"
|
|
|
|
#include "dZoneManager.h"
|
|
|
|
#include "GeneralUtils.h"
|
2023-12-29 04:24:30 +00:00
|
|
|
#include "eQuickBuildState.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-12-29 04:24:30 +00:00
|
|
|
void GfJailWalls::OnQuickBuildComplete(Entity* self, Entity* target) {
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
2021-12-05 17:54:36 +00:00
|
|
|
spawner->Deactivate();
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
2021-12-05 17:54:36 +00:00
|
|
|
spawner->Deactivate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-29 04:24:30 +00:00
|
|
|
void GfJailWalls::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
|
|
|
if (state != eQuickBuildState::RESETTING) return;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
2021-12-05 17:54:36 +00:00
|
|
|
spawner->Activate();
|
2022-07-28 13:39:57 +00:00
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("JailCaptain0" + wall)) {
|
2021-12-05 17:54:36 +00:00
|
|
|
spawner->Activate();
|
|
|
|
}
|
|
|
|
}
|