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

Recover Vessel refunds the stock part cost instead of the B9PartSwitch part cost. #208

Closed Dunbaratu closed 3 years ago

Dunbaratu commented 3 years ago

If this is not B9PartSwitch's fault, but something in KiwiTechTree, I apologize for reporting it in the wrong place. I am assuming it's B9PartSwitch because that's the mod that does the part variant switching for KiwiTechTree, which is where I encountered this.

Screenshots showing a small basic example, using KiwiTechTree's adjustments to this probe core:

Stock cost of the part is 7500 funds: screenshot42

KiwiTechTree uses B9PartSwitch to give this part a variant that has more ElectricCharge, and costs more (7968 funds): screenshot43

When I launch the 7968 fund variant of the part to the runway, then recover, I don't get the full cost of the vessel refunded like would happen in stock. Instead I get only 7500 back, which is the stock price of the part, not the B9PartSwitch adjusted price of the part: screenshot47

The cost adjustments that B9PartSwitch does to the parts doesn't seem to be taking effect during KSP's "recover vessel" system, as far as I can tell, making this either steal money from the player (when the adjusted part cost is higher than stock), or grant free money to the player (when the adjusted part cost is lower than stock.)

I was testing a ship I was going to send to Duna and was fiddling with the ladder positions to test that it would work, and i was noticing my funds dwindling, and I traced the cause down to this. Every "put it on launchpad and test it" iteration I was doing was refunding about 10,000 fewer funds back than it was costing.

blowfishpro commented 3 years ago

I'll look into it, I'm not at all surprised that module cost modifiers aren't being applied on recovery. Fair warning though, it may prove to be the case that this isn't fixable from B9PartSwitch's side, i.e. that it's a fundamental limitation of KSP's vessel recovery logic. But we'll see.

blowfishpro commented 3 years ago

So it's looking like KSP ignores module cost on recovery and there's probably not anything I can do about that.

Grimmas commented 3 years ago

This is a "feature" since KSP 1.11 or so. The KSP Recall mod has a temporary workaround.