mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 17:08:06 +00:00
Move to shared pointer
This commit is contained in:
@@ -9,21 +9,21 @@
|
||||
|
||||
void FvRaceSmashEggImagineServer::OnDie(Entity* self, Entity* killer) {
|
||||
if (killer != nullptr) {
|
||||
auto* destroyableComponent = killer->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = killer->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->SetImagination(destroyableComponent->GetImagination() + 10);
|
||||
EntityManager::Instance()->SerializeEntity(killer);
|
||||
}
|
||||
|
||||
// get possessor to progress statistics and tasks.
|
||||
auto* possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
auto possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent != nullptr) {
|
||||
|
||||
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||
if (possessor != nullptr) {
|
||||
|
||||
auto* missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
auto missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->UpdatePlayerStatistic(ImaginationPowerUpsCollected);
|
||||
characterComponent->UpdatePlayerStatistic(RacingSmashablesSmashed);
|
||||
|
@@ -19,13 +19,13 @@ void RaceImagineCrateServer::OnDie(Entity* self, Entity* killer) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* skillComponent = killer->GetComponent<SkillComponent>();
|
||||
auto skillComponent = killer->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = killer->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = killer->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->SetImagination(60);
|
||||
@@ -34,14 +34,14 @@ void RaceImagineCrateServer::OnDie(Entity* self, Entity* killer) {
|
||||
}
|
||||
|
||||
// Find possessor of race car to progress missions and update stats.
|
||||
auto* possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
auto possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent != nullptr) {
|
||||
|
||||
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||
if (possessor != nullptr) {
|
||||
|
||||
auto* missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
auto missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->UpdatePlayerStatistic(RacingImaginationCratesSmashed);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||
int32_t param2, int32_t param3) {
|
||||
if (sender->IsPlayer() && args == "powerup") {
|
||||
auto* possessorComponent = sender->GetComponent<PossessorComponent>();
|
||||
auto possessorComponent = sender->GetComponent<PossessorComponent>();
|
||||
|
||||
if (possessorComponent == nullptr) {
|
||||
return;
|
||||
@@ -21,7 +21,7 @@ void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr) {
|
||||
return;
|
||||
@@ -29,7 +29,7 @@ void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
|
||||
destroyableComponent->Imagine(10);
|
||||
|
||||
auto* missionComponent = sender->GetComponent<MissionComponent>();
|
||||
auto missionComponent = sender->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent == nullptr) return;
|
||||
missionComponent->Progress(eMissionTaskType::RACING, self->GetLOT(), (LWOOBJID)eRacingTaskParam::COLLECT_IMAGINATION);
|
||||
|
@@ -8,14 +8,14 @@
|
||||
|
||||
void RaceSmashServer::OnDie(Entity* self, Entity* killer) {
|
||||
// Crate is smashed by the car
|
||||
auto* possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
auto possessableComponent = killer->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent != nullptr) {
|
||||
|
||||
auto* possessor = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||
if (possessor != nullptr) {
|
||||
|
||||
auto* missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
auto missionComponent = possessor->GetComponent<MissionComponent>();
|
||||
auto characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->UpdatePlayerStatistic(RacingSmashablesSmashed);
|
||||
|
Reference in New Issue
Block a user