fix: the exploding script is the most amazing piece of code i have ev… (#1900)

* fix: the exploding script is the most amazing piece of code i have ever had the pleasure of working with and has been amazing to work on and translate from lua

hahahahahahahahahahwwwwwwwwwwwwwwww草

* Enhance hit detection with proximity object checks

Refactor hit handling to include proximity checks for destroyable entities.
This commit is contained in:
David Markowitz
2025-10-05 00:19:46 -07:00
committed by GitHub
parent 17d0c45382
commit 5791c55a9e

View File

@@ -49,7 +49,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
if (!self->GetBoolean(u"bIsHit")) {
for (const auto objID : proximityComponent->GetProximityObjects("crateHitters")) {
auto* const entity = Game::entityManager->GetEntity(objID);
if (!entity || !entity->IsPlayer()) continue;
if (!entity || entity->GetObjectID() != attacker->GetObjectID()) continue;
auto* const destroyable = entity->GetComponent<DestroyableComponent>();
if (destroyable) destroyable->Smash(attacker->GetObjectID());