mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 22:47:25 +00:00
fc75d6048f
* moving branch * Add deleteinven slash command * Change name of BRICKS_IN_BBB * Use string_view instead of strcmp * Clean up include tree * Remove unneeded headers from PCH files Removes unneeded headers from pre-compiled headers. This increases compile time, however reduces development time for most files. * Update Entity.h * Update EntityManager.h * Update GameMessages.cpp * There it compiles now Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
22 lines
641 B
C++
22 lines
641 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");
|
|
|
|
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);
|
|
}
|