mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-17 04:04:21 +00:00
chore: cleanup pointer management for LDF data (#1995)
* change network settings from vector to LwoNameValue * move settings on Entity to managed memory * Migrate more members * chore: remove pointer leakage from raw ldf pointers * feedback * fix ci
This commit is contained in:
@@ -204,12 +204,10 @@ void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo dig
|
||||
info.pos = self->GetPosition();
|
||||
info.rot = self->GetRotation();
|
||||
info.spawnerID = self->GetSpawnerID();
|
||||
info.settings = {
|
||||
new LDFData<LWOOBJID>(u"tamer", owner->GetObjectID()),
|
||||
new LDFData<std::string>(u"group", "pet" + std::to_string(owner->GetObjectID())),
|
||||
new LDFData<std::string>(u"spawnAnim", "spawn-pet"),
|
||||
new LDFData<float>(u"spawnTimer", 1.0)
|
||||
};
|
||||
info.settings.Insert<LWOOBJID>(u"tamer", owner->GetObjectID());
|
||||
info.settings.Insert<std::string>(u"group", "pet" + std::to_string(owner->GetObjectID()));
|
||||
info.settings.Insert<std::string>(u"spawnAnim", "spawn-pet");
|
||||
info.settings.Insert<float>(u"spawnTimer", 1.0);
|
||||
|
||||
auto* spawnedPet = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(spawnedPet);
|
||||
|
||||
@@ -66,14 +66,12 @@ void QbSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
info.rot = newRot;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
info.spawnerNodeID = 0;
|
||||
info.settings = {
|
||||
new LDFData<bool>(u"no_timed_spawn", true),
|
||||
new LDFData<float>(u"aggroRadius", 70),
|
||||
new LDFData<float>(u"softtetherRadius", 80),
|
||||
new LDFData<float>(u"tetherRadius", 90),
|
||||
new LDFData<float>(u"wanderRadius", 5),
|
||||
new LDFData<int>(u"mobTableLoc", i)
|
||||
};
|
||||
info.settings.Insert<bool>(u"no_timed_spawn", true);
|
||||
info.settings.Insert<float>(u"aggroRadius", 70);
|
||||
info.settings.Insert<float>(u"softtetherRadius", 80);
|
||||
info.settings.Insert<float>(u"tetherRadius", 90);
|
||||
info.settings.Insert<float>(u"wanderRadius", 5);
|
||||
info.settings.Insert<int>(u"mobTableLoc", i);
|
||||
|
||||
auto* child = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(child);
|
||||
|
||||
Reference in New Issue
Block a user