blowfishpro / B9PartSwitch

A Kerbal Space Program plugin designed to implement switching of part meshes, resources, and nodes
GNU Lesser General Public License v3.0
50 stars 33 forks source link

PAWs are not refreshed correctly for resources on symmetry counterparts when switching variants #215

Open ChrisAdderley opened 3 years ago

ChrisAdderley commented 3 years ago

As in the title.

This doesn't seem to occur for all symmetry counterparts but some subset. The resources don't seem to really exist (as measured by looking at ship total mass).

See more detail and reproduction steps here

DRVeyl commented 3 years ago

I believe this relates to some PAW caching behaviour, apparently introduced after KSP 1.8. (As in, this is not observed in a 1.8 build, but is in 1.10) See also https://github.com/NathanKell/ModularFuelSystem/issues/255 and a maybe heavy-handed fix https://github.com/NathanKell/ModularFuelSystem/pull/256

Heavy-handed because this ends up tracking if we would have marked the PAW dirty if it were open, but can't because it is not open. I think this has to do with updating symmetry counterparts during the onFieldChanged handler, instead of the onSymmetryFieldChanged handler. (onSymmetryFieldChanged has its problems, not suggesting that as a solution.)