Had a survival game where SMD did not fire on correctly, allowing one to hit, even though there were multiple loaded SMD. People have warned that this has happened before, and to not trust the Mobile SMD unit.
https://replay.faforever.com/27341539
About 4 nukes were launched at fanatazgara, who had multiple loaded SMD, and one hit. There were also two loaded Mobile SMD in-range. I don't know how FAF decides what SMD fires on what nuke, when coverage overlaps. I was also in the game, and my Mobile SMD fired on incoming nukes, as did the stationary SMD nearby me.
I don't know if the Mobile SMD unit is causing an issue and preventing stationary SMD from not firing. I tried recreating the issue in testing, but both Mobile and stationary SMD would fire properly.
The Mobile SMD uses the following script.
local SShieldHoverLandUnit = import('/lua/seraphimunits.lua').SShieldHoverLandUnit
local SIFHuAntiNukeWeapon = import("/lua/seraphimweapons.lua").SIFHuAntiNukeWeapon
--local nukeFiredOnGotTarget = false
MANTINUKE = Class(SShieldHoverLandUnit) {
Weapons = {
MissileRack = ClassWeapon(SIFHuAntiNukeWeapon) {
IdleState = State(SIFHuAntiNukeWeapon.IdleState) {
OnGotTarget = function(self)
local bp = self.Blueprint
if (bp.WeaponUnpackLockMotion != true or (bp.WeaponUnpackLocksMotion == true and not self.unit:IsUnitState('Moving'))) then
if (bp.CountedProjectile == false) or self:CanFire() then
nukeFiredOnGotTarget = true
end
end
SIFHuAntiNukeWeapon.IdleState.OnGotTarget(self)
end,
OnFire = function(self)
if not nukeFiredOnGotTarget then
SIFHuAntiNukeWeapon.IdleState.OnFire(self)
end
nukeFiredOnGotTarget = false
self.Trash:Add(ForkThread(function()
self.unit:SetBusy(true)
WaitSeconds(1/self.unit.Blueprint.Weapon[1].RateOfFire + .2)
self.unit:SetBusy(false)
end,self))
end,
},
},
},
I noticed that I'd commented out:
local nukeFiredOnGotTarget = false
I tried testing both with this line restored and tested with the line commented out, and the SMD behaved the same in both tests, as far as I could tell. Testing involved various combinations of stationary and mobile SMD interception swarms of nukes. Test were done without unit waves, just nukes, so much less going on during the tests than during a normal survival game.
