Starwaster / DeadlyReentry

Heat and force damage for KSP
Other
31 stars 19 forks source link

Two tweaks to cfgs #54

Closed NathanKell closed 3 years ago

NathanKell commented 3 years ago

First, convert FINAL pass specifiers to LAST[DeadlyReentry] now that LAST is available, to allow some level of mod interaction. Second, change leaveTemp handling so it plays nice with Kerbals and so it gets cleaned up afterwards rather than left in the PART as well as the MODULE (which causes PartLoader to spam errors about unknown fields during part compilation).

Starwaster commented 3 years ago

are you sure it's ok to !leaveTemp = DELETE now? That got broken in MM before.

NathanKell commented 3 years ago

Yup! The key thing about MM is that it processes top-level patches in a file in order, but inside a patch it processes all values before all nodes. So if you have

@NODE { value = ../var }
!var = DELETE

it will fail, because it will delete var before it's referenced in the node. But if you split them into two separate patches, it processes the patches in order, so it's safe. That's how we clean up RSSROConfig after checking for it a bunch.

NathanKell commented 3 years ago

(This is because when KSP loads confignodes, it loads all subnodes into its list of nodes, and all values into its list of values, so order between like is preserved but there's no concept of "this subnode was in the file before this value" or vice versa--MM runs off ConfigNodes, not off the file itself.)

NathanKell commented 3 years ago

And thanks for looking into these btw! :)