mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 14:03:34 +00:00
21 lines
731 B
C++
21 lines
731 B
C++
|
#include "RaceSmashServer.h"
|
||
|
#include "CharacterComponent.h"
|
||
|
#include "EntityManager.h"
|
||
|
#include "PossessableComponent.h"
|
||
|
|
||
|
void RaceSmashServer::OnDie(Entity *self, Entity *killer) {
|
||
|
// Crate is smashed by the car
|
||
|
auto* possessableComponent = killer->GetComponent<PossessableComponent>();
|
||
|
if (possessableComponent != nullptr) {
|
||
|
|
||
|
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||
|
if (possessor != nullptr) {
|
||
|
|
||
|
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||
|
if (characterComponent != nullptr) {
|
||
|
characterComponent->UpdatePlayerStatistic(RacingSmashablesSmashed);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|