fix: add missing racing scripts (#1708)

This commit is contained in:
David Markowitz
2025-01-01 10:54:21 -08:00
committed by GitHub
parent 94e7cfc211
commit 900c9b6abe
14 changed files with 193 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
#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");
}
}
}
}