mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 12:18:22 +00:00
24 lines
671 B
C++
24 lines
671 B
C++
|
#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);
|
||
|
}
|
||
|
}
|