mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-10 14:57:06 +00:00
17 lines
650 B
C++
17 lines
650 B
C++
#include "VehicleDeathTriggerWaterServer.h"
|
|
|
|
#include "PossessorComponent.h"
|
|
#include "RacingControlComponent.h"
|
|
|
|
void VehicleDeathTriggerWaterServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
|
if (target->IsPlayer() && !target->GetIsDead()) {
|
|
const std::vector<Entity*> racingControllers = Game::entityManager->GetEntitiesByComponent(RacingControlComponent::ComponentType);
|
|
for (auto* const racingController : racingControllers) {
|
|
auto* racingControlComponent = racingController->GetComponent<RacingControlComponent>();
|
|
if (racingControlComponent) {
|
|
racingControlComponent->OnRequestDie(target, u"death_water");
|
|
}
|
|
}
|
|
}
|
|
}
|