mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 23:43:34 +00:00
0545adfac3
Have fun!
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
#include "GfJailWalls.h"
|
|
#include "EntityManager.h"
|
|
#include "dZoneManager.h"
|
|
#include "GeneralUtils.h"
|
|
|
|
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();
|
|
}
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall))
|
|
{
|
|
spawner->Deactivate();
|
|
}
|
|
}
|
|
|
|
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state)
|
|
{
|
|
if (state != eRebuildState::REBUILD_RESETTING) return;
|
|
|
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("Jail0" + wall))
|
|
{
|
|
spawner->Activate();
|
|
}
|
|
|
|
for (auto* spawner : dZoneManager::Instance()->GetSpawnersByName("JailCaptain0" + wall))
|
|
{
|
|
spawner->Activate();
|
|
}
|
|
}
|