mirror of
https://github.com/Squareville/wonderland-server.git
synced 2026-01-11 16:35:12 -06:00
14 lines
421 B
C++
14 lines
421 B
C++
#include "SpawnEntityOnDeath.h"
|
|
#include "EntityInfo.h"
|
|
#include "Entity.h"
|
|
#include "EntityManager.h"
|
|
|
|
void SpawnEntityOnDeath::OnDie(Entity* self, Entity* killer) {
|
|
EntityInfo info{};
|
|
info.lot = m_SpawnLOT;
|
|
info.pos = self->GetPosition();
|
|
info.spawnerID = killer->GetObjectID();
|
|
auto spawnedEntity = Game::entityManager->CreateEntity(info, nullptr, killer);
|
|
Game::entityManager->ConstructEntity(spawnedEntity);
|
|
}
|