diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index 13b1fc4..08b29f3 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -2522,6 +2522,24 @@ void gBTHudPrimary = ((int)targetReticle.reticleElementMask & 0x20) != 0; } + // E8: pulse the three fire channels per frame (1,0,1,0...) so each + // weapon sim's CheckFireEdge sees clean rising edges. UNCONDITIONAL -- + // NOT inside the enemy block: firing needs only the world PICK (task + // #41: the beam goes to the scenery downrange with no enemy alive; the + // weapon's OWN HasActiveTarget gate refuses only a true sky shot). + // Leaving these inside `if (gEnemyMech)` froze the channels after the + // wreck buried -> no trigger edges -> "can't fire after the kill" + // (user-reported regression). targetInArc is the explicit BT_FIRE_ARC + // presentation clamp (default true). BT_AUTOFIRE holds all three. + { + const int laserWanted = gBTDrive.fireForced || gBTLaserKey; + const int ppcWanted = gBTDrive.fireForced || gBTPPCKey; + const int missileWanted = gBTDrive.fireForced || gBTMissileKey; + gBTWeaponTrigger = (laserWanted && targetInArc) ? (gBTWeaponTrigger ? 0 : 1) : 0; + gBTPPCTrigger = (ppcWanted && targetInArc) ? (gBTPPCTrigger ? 0 : 1) : 0; + gBTMissileTrigger = (missileWanted && targetInArc) ? (gBTMissileTrigger ? 0 : 1) : 0; + } + if (gEnemyMech != 0) { Point3D enemyPos = ((Mech *)gEnemyMech)->localOrigin.linearPosition; @@ -2583,19 +2601,7 @@ void gFireCooldown -= dt; const int fireWanted = gBTDrive.fireForced || gBTDrive.fire; - - // E8: pulse the three fire channels per frame (1,0,1,0...) so each - // weapon sim's CheckFireEdge sees clean rising edges. AUTHENTIC - // gating: the trigger passes through and the weapon's OWN - // HasActiveTarget gate decides (FireWeapon -- part_013.c:7758; no - // aim/arc test exists). targetInArc is the explicit BT_FIRE_ARC - // presentation clamp (default true). BT_AUTOFIRE holds all three. - const int laserWanted = gBTDrive.fireForced || gBTLaserKey; - const int ppcWanted = gBTDrive.fireForced || gBTPPCKey; - const int missileWanted = gBTDrive.fireForced || gBTMissileKey; - gBTWeaponTrigger = (laserWanted && targetInArc) ? (gBTWeaponTrigger ? 0 : 1) : 0; - gBTPPCTrigger = (ppcWanted && targetInArc) ? (gBTPPCTrigger ? 0 : 1) : 0; - gBTMissileTrigger = (missileWanted && targetInArc) ? (gBTMissileTrigger ? 0 : 1) : 0; + // (the fire-channel pulses moved ABOVE the enemy block -- task #43a) // Resolve the "explode" effect resource once. if (gExplodeReady == 0)