move IsDead to the DestroyableComponent

This commit is contained in:
jadebenn
2024-12-24 23:00:49 -06:00
parent 6ed6efa921
commit 81b4f84d03
17 changed files with 24 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
#include "ActSharkPlayerDeathTrigger.h"
#include "DestroyableComponent.h"
#include "MissionComponent.h"
#include "eMissionTaskType.h"
#include "Entity.h"
@@ -11,7 +12,7 @@ void ActSharkPlayerDeathTrigger::OnFireEventServerSide(Entity* self, Entity* sen
missionComponent->Progress(eMissionTaskType::SCRIPT, 8419);
if (sender->GetIsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
if (sender->GetComponent<DestroyableComponent>()->GetIsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
if (sender->GetCharacter()) {
sender->Smash(self->GetObjectID(), eKillType::VIOLENT, u"big-shark-death");

View File

@@ -1,8 +1,9 @@
#include "AgShipPlayerDeathTrigger.h"
#include "DestroyableComponent.h"
#include "Entity.h"
void AgShipPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
if (target->GetLOT() == 1 && !target->GetIsDead()) {
if (target->GetLOT() == 1 && !target->GetComponent<DestroyableComponent>()->GetIsDead()) {
target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"electro-shock-death");
}
}