Combat: FIX splash mis-routed onto the direct victim via the msgmgr (task #62)
User: struck a mech ~4x, still standing -- but the [dmghit] trace showed the DIRECT victim taking 16 applications for 8 impacts while the intended splash bystander took 0. Root cause: BTApplySplashDamage delivered splash through the shooter's SubsystemMessageManager::AddDamageMessage, which CONSOLIDATES every damage message of a frame onto the FIRST hit entity (commonDamageInformation. entityHit, messmgr.cpp:279). The direct hit registered the primary as the common entity, so the bystander's splash was consolidated onto the primary too -- the excluded direct victim took 8 direct + 8 mis-routed splash = 2x, and the real bystander took nothing. Fix: deliver splash with a DIRECT e->Dispatch to each victim, matching the T0 source (EXPLODE.cpp:246 target_entity->Dispatch); Dispatch reroutes cross-pod for a replicant on its own. Verified (BT_DMG_LOG): 8 impacts -> 8 dmghit on the direct victim + 8 on the bystander (was 16/0); no death; per-hit 5.83. KB: combat-damage.md warns not to route splash through the consolidating msgmgr. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fa0b825b60
commit
a9c0d2c854
@@ -1019,9 +1019,6 @@ void
|
||||
DEBUG_STREAM << "[splash] detonation radius=" << radius << " candidates="
|
||||
<< nc << " directVictim=" << (void *)directVictim << "\n" << std::flush;
|
||||
|
||||
SubsystemMessageManager *mgr = (weapon_subsys >= 0 && BTIsRegisteredMech(shooter))
|
||||
? (SubsystemMessageManager *)((Mech *)shooter)->GetMessageManager() : 0;
|
||||
|
||||
for (int ci = 0; ci < nc; ++ci)
|
||||
{
|
||||
Entity *e = cand[ci];
|
||||
@@ -1051,21 +1048,16 @@ void
|
||||
dmg.impactPoint = center;
|
||||
dmg.damageForce = Vector3D(dx, dy, dz); // EXPLODE.cpp:216 radial knockback
|
||||
|
||||
if (mgr != 0)
|
||||
{
|
||||
Entity::TakeDamageMessage td(
|
||||
Entity::TakeDamageMessageID, sizeof(Entity::TakeDamageMessage),
|
||||
shooter->GetEntityID(), -1 /*unaimed -> cylinder resolves*/,
|
||||
dmg, weapon_subsys);
|
||||
mgr->AddDamageMessage(e, &td);
|
||||
}
|
||||
else
|
||||
{
|
||||
Entity::TakeDamageMessage td(
|
||||
Entity::TakeDamageMessageID, sizeof(Entity::TakeDamageMessage),
|
||||
shooter->GetEntityID(), -1, dmg);
|
||||
e->Dispatch(&td);
|
||||
}
|
||||
// DIRECT dispatch to EACH victim (T0 EXPLODE.cpp:246 -- target->Dispatch).
|
||||
// NOT the shooter's SubsystemMessageManager: AddDamageMessage CONSOLIDATES
|
||||
// every damage message of the frame onto ONE common entity (the first hit,
|
||||
// messmgr.cpp:279) -- so routing splash through it delivered the bystander's
|
||||
// blast onto the DIRECT victim instead (double-hitting the excluded mech).
|
||||
// Dispatch reroutes cross-pod for a replicant victim on its own.
|
||||
Entity::TakeDamageMessage td(
|
||||
Entity::TakeDamageMessageID, sizeof(Entity::TakeDamageMessage),
|
||||
shooter->GetEntityID(), -1 /*unaimed -> cylinder resolves*/, dmg);
|
||||
e->Dispatch(&td);
|
||||
if (s_log)
|
||||
DEBUG_STREAM << "[splash] victim=" << e->GetEntityID() << " dist=" << dist
|
||||
<< " radius=" << radius << " bursts=" << bursts
|
||||
|
||||
Reference in New Issue
Block a user