KSP-RO / ProceduralParts

A continuation of StretchySRBs, which is a continuation of StretchyTanks
71 stars 79 forks source link

Fix dry mass displaying old value in PAW #306

Closed Scialytic closed 2 years ago

Scialytic commented 2 years ago

Sometimes changing a tank's contents also changes its dry mass, e.g., when using Nertea's CryoTanks. The old code displays the dry mass for the previous contents rather than the current contents. In the following screenshot, the PAW is displaying the dry mass for hydrolox (the previous option in the switcher) rather than LH2 only (the current setup).

bug

Here it is fixed by my tiny edit:

fixed

I don't know why part.mass gives stale data, but AFAICS there's no benefit to using part.mass over mass so I didn't bother investigating that further.

DRVeyl commented 2 years ago

Thanks for the fix. Just saw this.

Good catch. Why "mass" works but "part.mass" doesn't ... I assume this is running before part.mass gets updated and uses the IPartMassModifier callbacks. I think it ends up only inaccurate on this frame and only a display error, but still.