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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user