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:
David Markowitz
2026-06-14 20:54:52 -07:00
committed by GitHub
parent 90db1ac699
commit 0101933f5c
67 changed files with 676 additions and 754 deletions

View File

@@ -26,12 +26,10 @@ void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) {
info.rot = spawner->GetRotation();
info.lot = self->GetVar<LOT>(u"petLOT");
info.spawnerID = self->GetObjectID();
info.settings = {
new LDFData<LWOOBJID>(u"tamer", user->GetObjectID()),
new LDFData<std::u16string>(u"groupID", petType + (GeneralUtils::to_u16string(user->GetObjectID())) + u";" + petType + u"s"),
new LDFData<std::u16string>(u"spawnAnim", self->GetVar<std::u16string>(u"spawnAnim")),
new LDFData<float_t>(u"spawnTimer", 1.0f)
};
info.settings.Insert<LWOOBJID>(u"tamer", user->GetObjectID());
info.settings.Insert<std::u16string>(u"groupID", petType + (GeneralUtils::to_u16string(user->GetObjectID())) + u";" + petType + u"s");
info.settings.Insert<std::u16string>(u"spawnAnim", self->GetVar<std::u16string>(u"spawnAnim"));
info.settings.Insert<float_t>(u"spawnTimer", 1.0f);
auto* pet = Game::entityManager->CreateEntity(info);
Game::entityManager->ConstructEntity(pet);