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:
@@ -6,13 +6,11 @@
|
||||
void RockHydrantSmashable::OnDie(Entity* self, Entity* killer) {
|
||||
const auto hydrantName = self->GetVar<std::u16string>(u"hydrant");
|
||||
|
||||
LDFBaseData* data = new LDFData<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName));
|
||||
|
||||
EntityInfo info{};
|
||||
info.lot = ROCK_HYDRANT_BROKEN;
|
||||
info.pos = self->GetPosition();
|
||||
info.rot = self->GetRotation();
|
||||
info.settings = { data };
|
||||
info.settings.Insert<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName));
|
||||
info.spawnerID = self->GetSpawnerID();
|
||||
|
||||
auto* hydrant = Game::entityManager->CreateEntity(info);
|
||||
|
||||
Reference in New Issue
Block a user