mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-17 12:14: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:
@@ -66,7 +66,7 @@ void GfBanana::OnHit(Entity* self, Entity* attacker) {
|
||||
info.pos.z -= QuatUtils::Right(rotation).z * 5;
|
||||
info.rot = rotation;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
info.settings = { new LDFData<uint32_t>(u"motionType", 5) };
|
||||
info.settings.Insert<uint32_t>(u"motionType", 5);
|
||||
auto* const newEn = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(newEn);
|
||||
}
|
||||
|
||||
@@ -13,14 +13,12 @@ void PetDigBuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
info.pos = pos;
|
||||
info.rot = self->GetRotation();
|
||||
info.spawnerID = self->GetSpawnerID();
|
||||
info.settings = {
|
||||
new LDFData<LWOOBJID>(u"builder", target->GetObjectID()),
|
||||
new LDFData<LWOOBJID>(u"X", self->GetObjectID())
|
||||
};
|
||||
info.settings.Insert<LWOOBJID>(u"builder", target->GetObjectID());
|
||||
info.settings.Insert<LWOOBJID>(u"X", self->GetObjectID());
|
||||
|
||||
if (!flagNumber.empty()) {
|
||||
info.lot = 7410; // Normal GF treasure
|
||||
info.settings.push_back(new LDFData<std::u16string>(u"groupID", u"Flag" + flagNumber));
|
||||
info.settings.Insert<std::u16string>(u"groupID", u"Flag" + flagNumber);
|
||||
} else {
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr && missionComponent->GetMissionState(746) == eMissionState::ACTIVE) {
|
||||
|
||||
Reference in New Issue
Block a user