Fix High Explosive firing from MechLab
Correct the High Explosive ammo key and ensure positive-capacity weapons receive at least one starting round and ammo per pack. Apply MechLab special handling to weapon ID 87 and document activation, stacking, validation, and deployment requirements.
This commit is contained in:
@@ -1317,6 +1317,28 @@ tuple meanings, runtime offsets, legacy J&J formats, or BMP comparison rules fro
|
||||
intact/damaged states on physical MFD and Radar displays. Linux validation proves source/data
|
||||
equality and image alignment, not runtime hardware behavior.
|
||||
|
||||
## ✅ STEP 14: High Explosive MechLab firing repaired (2026-08-08)
|
||||
|
||||
High Explosives (weapon ID 87) could be installed in MechLab but never fired. They are ordinary
|
||||
one-shot weapons activated through their assigned weapon group (group 3 by default), **not** by
|
||||
ejecting. Put multiple charges in the same group and use Group Fire to detonate all of them in one
|
||||
trigger cycle; Chain Fire activates only one at a time. Each fired charge independently creates a
|
||||
100-damage blast in a 30 m radius and applies 200 center-torso damage to its own mech.
|
||||
|
||||
Three legacy defects made the feature unusable:
|
||||
- `HighExplosive.data` used the unregistered key `MaxAmmoCount=1`; the weapon model registers
|
||||
`MaxAmmo`, so the charge had no valid conventional ammo capacity.
|
||||
- MechLab computes initial ammo as `MaxAmmo / (3 * TotalSlotsTaken)`. Even with the corrected key,
|
||||
`1 / (3 * 2)` truncated to zero. `Weapon.cpp` now clamps starting ammo and ammo-per-pack to one
|
||||
only when the weapon declares a positive maximum; zero-capacity weapons remain unchanged.
|
||||
- `MechBay/weapons.script` applied High Explosive UI handling to stale ID 84 (NARC) instead of 87.
|
||||
|
||||
Linux validation confirmed High Explosive now constructs with one round, zero-capacity weapons
|
||||
still produce zero ammo packs, edited files retain their original CRLF/legacy encodings, and the
|
||||
focused diagnostics/diff checks are clean. Still required: rebuild `MW4.exe` on the Windows VC6
|
||||
machine, repack `props.mw4`, deploy both, then remove/reinstall the charge in existing saved variants
|
||||
that may retain serialized zero ammo.
|
||||
|
||||
## Next steps (proposed)
|
||||
- [ ] (Parked, diagnostics-only, cannot affect a real pod) Two gaps found while testing `-tident`
|
||||
on a **single-monitor VM** (2026-08-05). Both only occur when one physical monitor is exposed as
|
||||
|
||||
@@ -906,8 +906,10 @@ void
|
||||
if(model->maxAmmoCount > 0)
|
||||
{
|
||||
Verify(model->totalSlotsTaken != 0);
|
||||
create_message->ammoCount = model->maxAmmoCount / (3 * model->totalSlotsTaken);
|
||||
create_message->initialAmmoCount = model->maxAmmoCount / (3 * model->totalSlotsTaken);
|
||||
int ammo_count = model->maxAmmoCount / (3 * model->totalSlotsTaken);
|
||||
Min_Clamp(ammo_count, 1);
|
||||
create_message->ammoCount = ammo_count;
|
||||
create_message->initialAmmoCount = ammo_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1064,7 +1066,8 @@ int
|
||||
Verify(model->totalSlotsTaken != 0);
|
||||
int value = model->maxAmmoCount / (3 * model->totalSlotsTaken);
|
||||
|
||||
Min_Clamp(value, 0);
|
||||
if(model->maxAmmoCount > 0)
|
||||
Min_Clamp(value, 1);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1701,7 @@ s_weapon_slot
|
||||
|
||||
render_posy += getheight(slots[k].weapon_pic)
|
||||
|
||||
if slot_value[k] == 84
|
||||
if slot_value[k] == 87
|
||||
{
|
||||
slots[k].highexplosive = true
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ DamageAmount=100
|
||||
Tonage=2.0
|
||||
NumFire=1.0
|
||||
fireRate=0.15
|
||||
MaxAmmoCount=1
|
||||
MaxAmmo=1
|
||||
InitialLinearVelocity=0.0 0.0 0.0
|
||||
InitialLinearAcceleration=0.0 0.0 0.0
|
||||
SplashRadius=30.0
|
||||
|
||||
Reference in New Issue
Block a user