mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 21:47:24 +00:00
22 lines
721 B
C++
22 lines
721 B
C++
|
#include "FvRacePillarDServer.h"
|
||
|
#include "RenderComponent.h"
|
||
|
#include "RacingControlComponent.h"
|
||
|
|
||
|
void FvRacePillarDServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||
|
if (!target) return;
|
||
|
|
||
|
const auto racingControllers = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::RACING_CONTROL);
|
||
|
if (racingControllers.empty()) return;
|
||
|
|
||
|
auto* racingControlComponent = racingControllers[0]->GetComponent<RacingControlComponent>();
|
||
|
if (!racingControlComponent) return;
|
||
|
|
||
|
const auto* player = racingControlComponent->GetPlayerData(target->GetObjectID());
|
||
|
if (!player) return;
|
||
|
|
||
|
if (player->lap == 2) {
|
||
|
PlayAnimation("crumble", "pillars", m_PillarD);
|
||
|
PlayAnimation("roar", "dragon", m_Dragon);
|
||
|
}
|
||
|
}
|