2021-12-05 17:54:36 +00:00
|
|
|
#include "PropertyDeathPlane.h"
|
|
|
|
#include "Entity.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void PropertyDeathPlane::OnCollisionPhantom(Entity* self, Entity* target) {
|
|
|
|
const auto teleportGroup = EntityManager::Instance()->GetEntitiesInGroup("Teleport");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (teleportGroup.size() == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
auto* teleport = teleportGroup[0];
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
GameMessages::SendTeleport(target->GetObjectID(), teleport->GetPosition(), teleport->GetRotation(), target->GetSystemAddress());
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|