post-kerbin-mining-corporation / CryoTanks

Adds cryogenic fuel storage options and limited fuel switching to Kerbal Space Program
15 stars 30 forks source link

limit EC consumption to a minimum threshold #37

Closed blackliner closed 7 years ago

blackliner commented 7 years ago

New field minResToLeave to prevent totalt EC consumption (loss of vessel control etc.)

ChrisAdderley commented 7 years ago

I'm deferring this to next version because I really need to get these builds out.

blackliner commented 7 years ago

No worries, you need any help on that?

blackliner commented 7 years ago

How do you know that it's an expensive call? In my opinion, a part.requestresource somehow also needs to crawl through all EC containers, right?

Did you profile it, or is it an assumption? I don't want to seem sarcastic, I'd really like to know.

ChrisAdderley commented 7 years ago

I've been informed by people more in the know about the state of the code than either of us, let's say.

blackliner commented 7 years ago

Just to clarify, you are talking about the vessel.getConnected... , not the EC ID, right?

I'll try to think about something, but it needs to know about the current available EC. Maybe I find another function.

ChrisAdderley commented 7 years ago

Eh, it's probably fine. There's worse bottlenecks in the code for me to optimize.