Open midspace opened 6 years ago
I've done some testing, and it appears the game arbitrarily destroys all cubes within the center sphere of the warhead explosion. It ignores the "damage" setting of 0 entirely, as those cubes are simply destroyed.
I've logged an issue with Keen, however it might take a while to get a fix or a work-around that allows us to prevent those cubes from been destroyed.
I'm going to look for a method of blocking the trigger on the Warhead instead, and prevent it from exploding in the first place. I'm not sure if one exists currently.
I had a good look, and I can't find any way of overriding the Detonate action of the Warhead.
Hmm, a shame that we can't override it... For workarounds we have a few (bad and even worse) options:
IsArmed
to false
every tick. Evaluation: Might cause an impact on performance and cannot restrict ingame scripts from calling Detonate()
EDIT: If the performance impact of the last option is not too heavy it's the best choice in my opinion. But I think it's not a modder's job to implement workarounds for API bugs at the cost of performance.
The biggest risk is, a cube is built outside of the PA, the warheads enabled, and then sent in either remotely, or dumb launch. With either a Timer block, PB, or the warhead timer itself to detonate it.
That said, I did find a gap in the PA code, where the RegisterBeforeDamageHandler(object, MyDamageInformation)
was passing a IMyCubeBlock
instead of IMySlimBlock
in some cases. I am patching that now.
From SteamCommunity
http://steamcommunity.com/workshop/filedetails/discussion/316190120/1700542332339645945/