From a4f3362fd3c0451efec0db7246820b7411291c66 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 4 Oct 2025 20:59:00 -0700 Subject: [PATCH] Enhance hit detection with proximity object checks Refactor hit handling to include proximity checks for destroyable entities. --- dScripts/02_server/Map/General/ExplodingAsset.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dScripts/02_server/Map/General/ExplodingAsset.cpp b/dScripts/02_server/Map/General/ExplodingAsset.cpp index e073fffd..bba56f0c 100644 --- a/dScripts/02_server/Map/General/ExplodingAsset.cpp +++ b/dScripts/02_server/Map/General/ExplodingAsset.cpp @@ -47,8 +47,13 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) { if (!proximityComponent) return; if (!self->GetBoolean(u"bIsHit")) { - auto* const destroyable = attacker->GetComponent(); - if (destroyable) destroyable->Smash(attacker->GetObjectID()); + for (const auto objID : proximityComponent->GetProximityObjects("crateHitters")) { + auto* const entity = Game::entityManager->GetEntity(objID); + if (!entity || entity->GetObjectID() != attacker->GetObjectID()) continue; + + auto* const destroyable = entity->GetComponent(); + if (destroyable) destroyable->Smash(attacker->GetObjectID()); + } } attacker = attacker->GetOwner();