mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-23 14:07:20 +00:00
8d37d9b681
* Organize dScripts whitespace Remove parent scope Remove parent scope from initial setter Remove debug Remove helper programs * Fix NtImagimeterVisibility script Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
21 lines
617 B
C++
21 lines
617 B
C++
#include "HydrantSmashable.h"
|
|
#include "EntityManager.h"
|
|
#include "GeneralUtils.h"
|
|
|
|
void HydrantSmashable::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 = HYDRANT_BROKEN;
|
|
info.pos = self->GetPosition();
|
|
info.rot = self->GetRotation();
|
|
info.settings = { data };
|
|
info.spawnerID = self->GetSpawnerID();
|
|
|
|
auto* hydrant = EntityManager::Instance()->CreateEntity(info);
|
|
|
|
EntityManager::Instance()->ConstructEntity(hydrant);
|
|
}
|