2021-12-05 17:54:36 +00:00
|
|
|
#include "GfJailWalls.h"
|
|
|
|
#include "dZoneManager.h"
|
|
|
|
#include "GeneralUtils.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "eRebuildState.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
|
|
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
|
|
|
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("Jail0" + wall)) {
|
|
|
|
spawner->Deactivate();
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
|
|
|
spawner->Deactivate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
2023-05-02 22:39:21 +00:00
|
|
|
if (state != eRebuildState::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"));
|
|
|
|
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("Jail0" + wall)) {
|
|
|
|
spawner->Activate();
|
2022-07-28 13:39:57 +00:00
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall)) {
|
|
|
|
spawner->Activate();
|
|
|
|
}
|
|
|
|
}
|