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,6 +1,7 @@
#include "PetDigBuild.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
#include "MissionComponent.h"
#include "eMissionState.h"
@@ -45,7 +46,7 @@ void PetDigBuild::OnDie(Entity* self, Entity* killer) {
return;
// If the quick build expired and the treasure was not collected, hide the treasure
if (!treasure->GetIsDead()) {
if (!treasure->GetComponent<DestroyableComponent>()->GetIsDead()) {
treasure->Smash(self->GetObjectID(), eKillType::SILENT);
}
}