-
Notifications
You must be signed in to change notification settings - Fork 1
[Bug] FailOnMissingItems check breaks apparel-mounted weapons (e.g. DMS Mobile Dragoon missile pods) #3
Description
Summary
ThrowThem's Harmony patch on JobDriver_AttackStatic.MakeNewToils silently cancels
attack jobs for any apparel-mounted ranged weapon, making them completely non-functional
when ThrowThem is active.
Affected mods (confirmed)
- Dead Man's Switch - Mobile Dragoon (shoulder missile pods, smoke launchers, etc.)
- Likely any mod that puts ranged verbs on worn apparel
Root cause
In `JobDriver_AttackStatic_MakeNewToils.cs`, a Prefix adds an end condition via
`HelperClass.FailOnMissingItems`:
if (verbToUse?.EquipmentSource != null)
{
__instance.FailOnMissingItems(pawn, pawn.CurJob.verbToUse.EquipmentSource);
}HelperClass.FailOnMissingItems returns JobCondition.Incompletable if the item is not
found in pawn.equipment OR pawn.inventory:
if (!x.equipment.Contains(t) && !x.inventory.Contains(t))
return JobCondition.Incompletable;For apparel-mounted weapons, EquipmentSource is the worn apparel piece — which lives
in pawn.apparel, not in pawn.equipment or pawn.inventory. The check always fails,
the job is immediately cancelled on its first tick, and no error is logged, making
this very hard to diagnose.
Reproduction steps
- Install Dead Man's Switch - Mobile Dragoon + its dependencies
- Install Throw Them
- Equip a mech with a shoulder missile pod (any)
- Draft the pawn, click the missile pod fire gizmo with mouse or hotkey
- Nothing happens — no targeting, no shot, no log output
(Without ThrowThem: works fine)
Proposed fix
Add pawn.apparel to the FailOnMissingItems check in HelperClass.cs:
// Before:
if (!x.equipment.Contains(t) && !x.inventory.Contains(t))
return JobCondition.Incompletable;
// After:
if (!x.equipment.Contains(t) && !x.inventory.Contains(t)
&& !x.apparel.WornApparel.Contains(t))
return JobCondition.Incompletable;This is a one-line change that keeps all existing ThrowThem behaviour intact while
allowing apparel-mounted weapons to function normally.