mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 15:57:13 +00:00
The zone manager keeps an index of spawners by object ID; the spawner now belongs to the SpawnerComponent of its LOT 176 object and goes with it (the component tells the zone manager to stop indexing it). Spawning, timers and the update order are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
571 B
C++
18 lines
571 B
C++
#include "SpawnerComponent.h"
|
|
|
|
#include "Entity.h"
|
|
#include "Game.h"
|
|
#include "Spawner.h"
|
|
#include "dZoneManager.h"
|
|
|
|
SpawnerComponent::SpawnerComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {}
|
|
|
|
// The zone manager stops indexing the spawner before it goes with the object
|
|
SpawnerComponent::~SpawnerComponent() {
|
|
if (m_Spawner && Game::zoneManager) Game::zoneManager->ForgetSpawner(m_Parent->GetObjectID(), m_Spawner.get());
|
|
}
|
|
|
|
void SpawnerComponent::SetSpawner(std::unique_ptr<Spawner> spawner) {
|
|
m_Spawner = std::move(spawner);
|
|
}
|