mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-17 12:14:21 +00:00
* 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
20 lines
590 B
C++
20 lines
590 B
C++
#include "HydrantSmashable.h"
|
|
#include "EntityManager.h"
|
|
#include "EntityInfo.h"
|
|
#include "GeneralUtils.h"
|
|
|
|
void HydrantSmashable::OnDie(Entity* self, Entity* killer) {
|
|
const auto hydrantName = self->GetVar<std::u16string>(u"hydrant");
|
|
|
|
EntityInfo info{};
|
|
info.lot = HYDRANT_BROKEN;
|
|
info.pos = self->GetPosition();
|
|
info.rot = self->GetRotation();
|
|
info.settings.Insert<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName));
|
|
info.spawnerID = self->GetSpawnerID();
|
|
|
|
auto* hydrant = Game::entityManager->CreateEntity(info);
|
|
|
|
Game::entityManager->ConstructEntity(hydrant);
|
|
}
|