mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-16 21:18:28 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
24
dScripts/RockHydrantSmashable.cpp
Normal file
24
dScripts/RockHydrantSmashable.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "RockHydrantSmashable.h"
|
||||
#include "EntityManager.h"
|
||||
#include "SimplePhysicsComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "Game.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void RockHydrantSmashable::OnDie(Entity* self, Entity* killer) {
|
||||
SimplePhysicsComponent* physics = self->GetComponent<SimplePhysicsComponent>();
|
||||
NiPoint3 pos = physics->GetPosition();
|
||||
|
||||
EntityInfo info;
|
||||
info.lot = 12293;
|
||||
info.pos = pos;
|
||||
info.spawner = nullptr;
|
||||
info.spawnerID = self->GetSpawnerID();
|
||||
info.spawnerNodeID = 0;
|
||||
|
||||
Entity* newEntity = EntityManager::Instance()->CreateEntity(info, nullptr);
|
||||
if (newEntity) {
|
||||
EntityManager::Instance()->ConstructEntity(newEntity);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user