Public release of the DLU server code!

Have fun!
This commit is contained in:
Unknown
2021-12-05 18:54:36 +01:00
parent 5f7270e4ad
commit 0545adfac3
1146 changed files with 368646 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
#include "RaceImagineCrateServer.h"
#include "SkillComponent.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "CharacterComponent.h"
#include "PossessableComponent.h"
void RaceImagineCrateServer::OnDie(Entity* self, Entity* killer)
{
if (self->GetVar<bool>(u"bIsDead"))
{
return;
}
//GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
self->SetVar<bool>(u"bIsDead", true);
if (killer == nullptr)
{
return;
}
auto* skillComponent = killer->GetComponent<SkillComponent>();
if (skillComponent == nullptr)
{
return;
}
auto* destroyableComponent = killer->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr)
{
destroyableComponent->SetImagination(60);
EntityManager::Instance()->SerializeEntity(killer);
}
// Crate is killed 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(RacingImaginationCratesSmashed);
characterComponent->UpdatePlayerStatistic(RacingSmashablesSmashed);
}
}
}
//skillComponent->CalculateBehavior(586, 9450, killer->GetObjectID(), true);
}