From e9dd2c9473179e3b08e693e545a35af2dd50715a Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sat, 26 Sep 2026 18:45:53 -0500 Subject: [PATCH] fix: exploding assets only explode once The live script (L_EXPLODING_ASSET.lua) does everything inside "if not bIsHit": smash the attacker if they stand within 10 units, cast the explosion skill, smash itself and progress missions. The server only guarded the attacker smash, so another hit before the asset despawned cast the skill and progressed missions again. The TODO asking to kill everything in a radius is obsolete: live smashes only the attacker directly, and everyone else in range takes the explosion skill's damage, which the server already casts. Removed it. Co-Authored-By: Claude Opus 5.5 --- .../02_server/Map/General/ExplodingAsset.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dScripts/02_server/Map/General/ExplodingAsset.cpp b/dScripts/02_server/Map/General/ExplodingAsset.cpp index bba56f0cf..f4902a2ce 100644 --- a/dScripts/02_server/Map/General/ExplodingAsset.cpp +++ b/dScripts/02_server/Map/General/ExplodingAsset.cpp @@ -10,9 +10,6 @@ #include "TeamManager.h" #include "ProximityMonitorComponent.h" -//TODO: this has to be updated so that you only get killed if you're in a certain radius. -//And so that all entities in a certain radius are killed, not just the attacker. - void ExplodingAsset::OnStartup(Entity* self) { self->SetProximityRadius(20.0f, "outRadius"); self->SetVar(u"playersNearChest", 0); @@ -46,14 +43,16 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) { const auto* const proximityComponent = self->GetComponent(); if (!proximityComponent) return; - if (!self->GetBoolean(u"bIsHit")) { - for (const auto objID : proximityComponent->GetProximityObjects("crateHitters")) { - auto* const entity = Game::entityManager->GetEntity(objID); - if (!entity || entity->GetObjectID() != attacker->GetObjectID()) continue; + // Like the live script, the asset only explodes once. Only the attacker is smashed directly, and only when + // standing close to the asset; everyone else in range is hit by the explosion skill. + if (!attacker || self->GetBoolean(u"bIsHit")) return; - auto* const destroyable = entity->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();