mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
fix: add missing racing scripts (#1708)
This commit is contained in:
@@ -7,4 +7,5 @@ set(DSCRIPTS_SOURCES_AI_RACING_OBJECTS
|
||||
"FvRacePillarDServer.cpp"
|
||||
"FvRaceSmashEggImagineServer.cpp"
|
||||
"RaceSmashServer.cpp"
|
||||
"VehicleDeathTriggerWaterServer.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
dScripts/ai/RACING/OBJECTS/VehicleDeathTriggerWaterServer.h
Normal file
11
dScripts/ai/RACING/OBJECTS/VehicleDeathTriggerWaterServer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef VEHICLEDEATHTRIGGERWATERSERVER_H
|
||||
#define VEHICLEDEATHTRIGGERWATERSERVER_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class VehicleDeathTriggerWaterServer : public CppScripts::Script {
|
||||
public:
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
||||
#endif //!VEHICLEDEATHTRIGGERWATERSERVER_H
|
Reference in New Issue
Block a user