mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Organize dScripts (#814)
* 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>
This commit is contained in:
3
dScripts/ai/PETS/CMakeLists.txt
Normal file
3
dScripts/ai/PETS/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_AI_PETS
|
||||
"HydrantSmashable.cpp"
|
||||
PARENT_SCOPE)
|
20
dScripts/ai/PETS/HydrantSmashable.cpp
Normal file
20
dScripts/ai/PETS/HydrantSmashable.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#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);
|
||||
}
|
10
dScripts/ai/PETS/HydrantSmashable.h
Normal file
10
dScripts/ai/PETS/HydrantSmashable.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class HydrantSmashable : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
private:
|
||||
LOT HYDRANT_BROKEN = 7328;
|
||||
};
|
Reference in New Issue
Block a user