mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-24 00:08:07 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
20
dScripts/RaceSmashServer.cpp
Normal file
20
dScripts/RaceSmashServer.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user