Version: 6.20
Language: English
Modified: No
Game Start: Budgeted Start
Problem:
S\M ships equipped with EMP missiles won't fire them when attacking another ship of M size or smaller.
How to Reproduce:
Load a fighter with missile launchers, and only EMP missiles. Tell them to attack a (M or smaller) target and they will chase them but never fire a shot.
Alternatively - arm a fighter with mixed weapon loadouts (missiles + normal weapons), they will fire their regular weapons, but not any of their EMP missiles.
Loading the save below, there are two Asps with loadouts as above.
Use either Asp to target any M or smaller ship in the area.
Watch them do their attack runs, noting their missile amounts in their loadout, and that they never use them.
Save File:
https://drive.google.com/file/d/1OnZA4i ... sp=sharing
Notes:
This bug was actually sent to me by DeadAir. I double checked and tested the bug myself, and can confirm that fighters will never fire EMPs in the above situation.
Research:
There appears to be a bug within the "fight.attack.object.fighter.xml" with the line:
Code: Select all
<do_if value="not $target.isclass.ship_xs and ((not this.ship.dps.lasers.all and this.ship.dps.missiles.all) or (this.ship.dps.missiles.all gt 0 and player.age gt $delaymissiles))">
Secondly, the section: "not this.ship.dps.lasers.all and this.ship.dps.missiles.all" is intended to filter out ships so that we are left with ships that only have missiles, however it doesn't check the existence of missile weapons, instead it checks if the weapon groups have any DPS. A 0 here will evaluate to false, so this check fails as well due to EMPs having 0 damage.
Fix:
A fix that maintains the status quo would be to change the check from the missile dps amount to the missile storage amount.
Code: Select all
<do_if value="not $target.isclass.ship_xs and ((not this.ship.dps.lasers.all and this.ship.ammostorage.missile.count) or (this.ship.ammostorage.missile.count gt 0 and player.age gt $delaymissiles))">